This seems so basic, but it's had me stumped for a while - please help.
I have a simple Assembly for a Frame that I made with Frame Generator.
I'd like to use a rule to toggle the visible of some of the framing members.
In the sub assembly (called Frame0001:1) I created a rule:
(I have a variable called LeftAngle, and the bar I want to toggle is called Bar1.)
-------
If LeftAngle = 90 then
Component.Visible("Bar1") = False
Else
Component.Visible("Bar1") = True
End If
---------
I am sure this is VERY basic, but I can't get it to do anything. There is no error message - just nothing happens.
I know the rule is running though - it will change other parameters in response to the If Then statement.
Thanks for any help!
Solved! Go to Solution.
Solved by Inv_kaos. Go to Solution.
You need to put the rule in the main assembly, not the frame generator assembly. It treats the FG parts as parts of the main assembly.
Thank you for your help. I tried the same logic in the parent assembly and am able to toggle visibility for parts in the parent assembly - just like you said.
However, I can't figure out how to properly refer to parts in the subform. I'm sure it's very simple, but I haven't been able to find the answer online.
Please help,
Thank you!
What do you mean by subform, are these parts in another sub assembly or do you have a vb form?
I got it working:
Component.Visible(MakePath("Frame0001:1", "ExtraLeft1")) = False
I'm sure there are more elegent ways, but this seems to work.
Nice, that works fine. You could also place a similar rule to that in your main assembly in your sub assemblies then call it with RunRule in Component. Means less code in your main assembly if that is a problem.
iLogicVb.RunRule("PartA:1", "ruleName")