Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

assembly constraints driven by ilogic

2 REPLIES 2
Reply
Message 1 of 3
deltades
1573 Views, 2 Replies

assembly constraints driven by ilogic

I want to use I logic to adjust an assembly constraint based on T/F value passed from a master sketch. 

I have passed the paramater T/F and/or a user paramater as described in this thread using link (neet trick).. but when the code fires it only works on the true application and not the false.. if i open the rule and then close it the update button  becomes available and when updated the false condition updates sucessfully. I have tried just re-running the rule to no avail. It seams that the only way I can get it to triger a false condition is to open the rule... close it and update. Smiley Frustrated

any ideas?

 

If Parameter("iTrigger0101000") = 1 Then
d37_Header1 = -.25 in
d34_Header2 = -.25 in
ElseIf Parameter("iTrigger0101000") = 0 Then
d37_Header1 = -.25 in
d34_Header2 = 0.0 in
End If
2 REPLIES 2
Message 2 of 3

Hi deltades,

 

I'm confused about the use of the iTrigger parameter, as those are numerical parameters by default, rather than true/false parameters.

 

Attached is a quick example that has the boolean (true/false) parameter in the assembly, and uses a radio box to set this parameter and set the part parameter named d0.

 

Does this help or make things less clear?

 

'get user input to change the boolean parameter found in the assembly file
MyBoolean = InputRadioBox("Select an option:", "Small", "Large", MyBoolean, "iLogic")

'apply input to condition
If MyBoolean = True Then
'update part parameter
Parameter("Cube:1", "d0") = 1
Else If MyBoolean = False Then
'update part parameter
Parameter("Cube:1", "d0") = 2
End if
'update part
InventorVb.DocumentUpdate()
MessageBox.Show("MyBoolean = " & MyBoolean, "iLogic")
'zoom all
ThisApplication.ActiveView.Fit

 I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

Message 3 of 3

Ok... I revised this to use a boolean described as you described see below..

In my skeleton sketch master file I have a form that selects from a series of case statements setting key dims and the condition of "FR_Door" T/F

the assembly is supposed to update the assembly constraint dims "d37... and d34..." per the condition of the boolean.

so I go to my skeleton and select the condition that will make "FR_Door" true and go back to the assembly and update.

No results until I open the rule editor close it.. making no changes... and hit the update button. VisaVersa for the false condition and the same result. hit the update button and the dims for the geometry update properly but the constraints do not until the rule editor is opened and closed and the update button hit again.

The rule is working... its just not working until I open/close the rule editor and update.

By the way in the "rules triggered by events" diloge the rule is supposed to trigger on "any model parameter change"

I have defined the parameter in the skeleton as a simple unitless user param "iTrigger0101001" "iTrigger" in reference to the fact that the param is supposed to be used to trigger an event and ("prefix name" 0101001.iam) in referance to the assembly that it is supposed to drive using 0 and 1 for the conditions. but it doesnt matter. regardless of how I have defined this it does not properly update until the rule editor is opened so that the param from my seleton sketch gets updated to its value and then is applied upon update.

I even tried "get Parameter("AC100-0100MRL-S:3", "FR_Door")" but that gave me an error that said that the function "get" is no longer supported.

This should be working.. It is working but only when I take steps to open/close and update.. very annoying and odd. Thanks in advance for the assist

 

MyBoolean = Parameter("AC100-0100MRL-S:3", "FR_Door")

If MyBoolean = True Then
d37_Header1 = -.25 in
d34_Header2 = -.25 in
ElseIf MyBoolean = False Then
d37_Header1 = -.25 in
d34_Header2 = 0.0 in
End If
InventorVb.DocumentUpdate()

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report