Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Anonymous
4820 Views, 6 Replies

link a new parameter to a custom iproperty

In an assembly drawing, I am wanting to pull information from various subassemblies to show as information in a text box. I can get the information to populate in a custom iProperty, & noticed that the text block can pull from parameters in subassemblies & parts. Is there a way to link a user parameter to the custom iproperty?

 

Thanks,

Nathan

BrandonBG
in reply to: Anonymous
Anonymous
in reply to: BrandonBG

The opposite direction, instead of parameter to iProperty, I need iProperty to parameter.

Vladimir.Ananyev
in reply to: Anonymous

You may consider the following simple iLogic rule.

It reads the custom property "AAA" value and then assigns it to the user-defined text parameter “Parameter_AAA”:

' iLogic rule 'UpdateUserParameter'
' reads custom property "AAA" value Dim PropValue As String = iProperties.Value("Custom", "AAA") 'updates the user-defined text parameter Parameter_AAA = PropValue   'this message is for debugging only MsgBox("Parameter was updated: " & Parameter_AAA)

Using iLogic event you may handle iProperty changes automatically:

Events.PNG


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

Anonymous
in reply to: Vladimir.Ananyev

This ran and showed a comment box that the parameter was updated. My custom iproperty I had named as Weight, so I changed everything in the iLogic that was "AAA" to "Weight." I then created a user text parameter "Weight." Ran the rule. Message box says  "Parameter was updated: 335.08 lbs." When I check the parameter I created, it is blank. What parameter is updated, and where do I find it?

Vladimir.Ananyev
in reply to: Anonymous

 I expect your updated rule  looks like this:

Dim PropValue As String = iProperties.Value("Custom", "AAA")
'updates the user-defined text parameter
Weight = PropValue
 
'this message is for debugging only
MsgBox("Parameter was updated: " & Weight)

Name in blue should be the name of your user parameter.


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

Anonymous
in reply to: Vladimir.Ananyev

I believe this works. Awesome! Thank you for the help & the code.