link a new parameter to a custom iproperty

link a new parameter to a custom iproperty

Anonymous
Not applicable
5,040 Views
6 Replies
Message 1 of 7

link a new parameter to a custom iproperty

Anonymous
Not applicable

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

0 Likes
Accepted solutions (1)
5,041 Views
6 Replies
Replies (6)
Message 2 of 7

BrandonBG
Collaborator
Collaborator
0 Likes
Message 3 of 7

Anonymous
Not applicable

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

0 Likes
Message 4 of 7

Vladimir.Ananyev
Alumni
Alumni

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

0 Likes
Message 5 of 7

Anonymous
Not applicable

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?

0 Likes
Message 6 of 7

Vladimir.Ananyev
Alumni
Alumni
Accepted solution

 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

0 Likes
Message 7 of 7

Anonymous
Not applicable

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

0 Likes