Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
WCrihfield
in reply to: max.baumann07

Hi @max.baumann07.  That 'iProperties.Value()' iLogic shortcut snippet does not know which specific document to target.  There are ways to add a third input into it, as its first input, in an attempt to tell it which document to target, but they are not always that great (Link1, Link2).  If you want it to target a specific 'component' in an assembly, you can supply the ComponentOccurrence.Name value (as String) as the first (of 3) inputs.  If targeting a referenced document, instead of a component, you can usually supply the Document.DisplayName value there, but that doesn't always work good either.  The best way may be to do it the API way 

Document.PropertySets.Item(4).Item("CustomPropertyName").Value = 

but that will not create the property, if it does not already exist.  You would have to use a Try...Catch block, where you try to access that property and/or set its value in the Try side, and if that fails, try to create it in the Catch side, and set its value there, as you create it.  I'm using Index 4, because the 'custom' property set is always the fourth one.  The PropertySet object has a method for creating a new property.

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)