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: 

Using a rule to toggle part visibility

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
Anonymous
656 Views, 6 Replies

Using a rule to toggle part visibility

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!

6 REPLIES 6
Message 2 of 7
Inv_kaos
in reply to: Anonymous

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.

Please mark as "Accept as Solution" if it answers your question or "Kudos" if you found it useful.
---------------------------------------------------------------------------------------------------------------------
Stew, AICP
Inventor Professional 2013, Autodesk Simulation Multiphysics 2013
Windows 7 x64 Core i7 32GB Ram FX2000
Message 3 of 7
Anonymous
in reply to: Inv_kaos

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!

Message 4 of 7
Inv_kaos
in reply to: Anonymous

What do you mean by subform, are these parts in another sub assembly or do you have a vb form?

Please mark as "Accept as Solution" if it answers your question or "Kudos" if you found it useful.
---------------------------------------------------------------------------------------------------------------------
Stew, AICP
Inventor Professional 2013, Autodesk Simulation Multiphysics 2013
Windows 7 x64 Core i7 32GB Ram FX2000
Message 5 of 7
Anonymous
in reply to: Anonymous

Sorry about that. I meant subassembly.
Message 6 of 7
Anonymous
in reply to: Anonymous

I got it working:

 

       Component.Visible(MakePath("Frame0001:1", "ExtraLeft1")) = False

 

I'm sure there are more elegent ways, but this seems to work.

Message 7 of 7
Inv_kaos
in reply to: Anonymous

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")

 

Please mark as "Accept as Solution" if it answers your question or "Kudos" if you found it useful.
---------------------------------------------------------------------------------------------------------------------
Stew, AICP
Inventor Professional 2013, Autodesk Simulation Multiphysics 2013
Windows 7 x64 Core i7 32GB Ram FX2000

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

Post to forums  

Autodesk Design & Make Report