Parameter change rule trigger

Parameter change rule trigger

gcoombridge
Advisor Advisor
427 Views
4 Replies
Message 1 of 5

Parameter change rule trigger

gcoombridge
Advisor
Advisor

Hi,

 

This should be an easy one - I have a large configuration model that I'm building with MANY parameters and I've been playing with some more concise ways of laying out the code than  This Parameter from this model = That Parameter in the assembly.

 

I laid it out so that one set of code was placed in a private sub and the title of all of the parameters are built from a string. Unfortunately because the parameters are not explicitly named (i.e. blue) they don't trigger the rule.. Is there any way around this?

 

Thanks for your help!

 

Sub Main
'Get the path of the current assembly because the nozzles will be in a subfolder 

Call SideNozzle("Alpha", "α")
Call SideNozzle("Beta", "β")
Call SideNozzle("Gamma", "γ")
Call SideNozzle("Delta", "δ")
Call SideNozzle("Epsilon", "ε")

End Sub


Private Sub SideNozzle(CharacterString As String, LetterString As String)

	'Params downstream to nozzle sub-assembly
	Parameter(CharacterString & " Nozzle:1", "NozzleDesignation") = Parameter(LetterString & "_Nozzle_Designation")
	Parameter(CharacterString & " Nozzle:1", "NozzleDescription") = Parameter(LetterString & "_Nozzle_Description")

End Sub

 

 

Use iLogic Copy? Please consider voting for this long overdue idea (not mine):https://forums.autodesk.com/t5/inventor-ideas/string-replace-for-ilogic-design-copy/idi-p/3821399
0 Likes
428 Views
4 Replies
Replies (4)
Message 2 of 5

WCrihfield
Mentor
Mentor

If the parameters are Model parameters, then they will work with the Event Trigger "Any Model Parameter Change", but if they are User Parameters or other, you will have to set-up what I call 'dummy variables' which you will use with the real names of those parameters.  At the top of the rule code, create a set of these dummy variables (ones that you're not going to use for anything), then set their values to the parameter names (should turn blue).  This will cause the rule to fire any time any of those parameters change.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 3 of 5

gcoombridge
Advisor
Advisor

Thanks, I've taken that approach before but in this case I'll have say 6 type of parameter with 20 different prefixes so that will be just as bad as naming them in the body of the code. I was looking for a more elegant way to compose it but it may not be possible without the user explicitly running the code from a form.

 

The event trigger is too coarse in this case because this rule is one of many in the assembly. Thanks for your help

Use iLogic Copy? Please consider voting for this long overdue idea (not mine):https://forums.autodesk.com/t5/inventor-ideas/string-replace-for-ilogic-design-copy/idi-p/3821399
0 Likes
Message 4 of 5

WCrihfield
Mentor
Mentor

Since you seem to be transferring values from the parameters in one document to another, would using a link to an external Excel file for the Parameters work for you?  Have you ever done this before?  When inside the Parameters dialog box of a model file, there is a [Link] button, that allows you to link to an Excel file for some or all of your parameters.  Usually when you do this, the parameters within the Parameters dialog box of the target model file will be shown, but greyed out, so they can only be changed by the Excel file.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 5 of 5

gcoombridge
Advisor
Advisor

Thanks WCrihfield. I will look at using excel as a container. When I think about the original question a little further it makes sense. The strings are being built in the rule and don't exist separately from it.. Thanks again for your time

 

Glenn 

Use iLogic Copy? Please consider voting for this long overdue idea (not mine):https://forums.autodesk.com/t5/inventor-ideas/string-replace-for-ilogic-design-copy/idi-p/3821399
0 Likes