- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Guys,
Cannot get this code to run as an external rule. It fails when it tries to create the iproperty "PropertyName1"
I think its to do with the "ThisApplication.ActiveDocument" part but not sure
any ideas?
' checks to see if custom iproperty etch_number exists, creates it if it is not in document
' sets value of EtchNumber iprop
Dim TempEtchNumber As String = iProperties.Value("Project", "Part Number")
TempEtchNumber= TempEtchNumber.Replace("-","")
TempEtchNumber =TempEtchNumber.substring(4)
Dim PropertyName1 As String = "EtchNumber"
oCustomPropertySet = ThisApplication.ActiveDocument.PropertySets.Item("Inventor User Defined Properties")
'look for custom iproperty and try to use it
Try
oProp = oCustomPropertySet.Item(PropertyName1)
Catch
' iproperty not found , create and assign value
oCustomPropertySet.Add("",PropertyName1)
End try
'iProperties.Value("Custom","EtchNumber") = TempEtchNumber
I am using INV 2009
Solved! Go to Solution.