Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Sergio.D.Suárez
in reply to: gconley

Hi, a recommendation when working with ilogic is that even when it is not necessary to define the variables, put the variable type and define it correctly. This is a classic type of error that happens due to lack of definition of values.
Here are two methods of how I would try to solve the problem.

 

dim customPropertySet as inventor.PropertySet= ThisDoc.Document.PropertySets.Item("Inventor User Defined Properties")

Dim dtDate As Date = Now

Dim iprop(2) As String
iprop(1) = "Released for Construction"
iprop(2) = "Released for Review"

Try
  prop = customPropertySet.Item(iprop(1))
Catch
  customPropertySet.Add(dtDate, iprop(1))   
End Try

Try
  prop = customPropertySet.Item(iprop(2))
Catch
  customPropertySet.Add(dtDate, iprop(2))   
End Try

Here is a simpler method when working on the active document using ilogic shortcuts

Dim iprop(2) As String
iprop(1) = "Released for Construction"
iprop(2) = "Released for Review"

iProperties.Value("Custom", iprop(1)) = Now
iProperties.Value("Custom", iprop(2)) = Now

Hope this helps with your problem. Cheers!


Please accept as solution and give likes if applicable.

I am attaching my Upwork profile for specific queries.

Sergio Daniel Suarez
Mechanical Designer

| Upwork Profile | LinkedIn