I am working on an assembly with lots of parts that are turned on and off (Component.IsActive) using ilogic, depending on which is selected. The model is for a steel door, and the parts we have constrained are all the various options for hardware, such as lock cases and door closers. All the parts are already set up in a library, but are also present in our top level assembly.
As the assembly is getting bloated with all the parts and constraints, I was wondering if it was possible to have ilogic automatically insert (and constrain) a part from a library into the active assembly, not just unsuppress a previously inserted part.
Does anyone know of a way to do this with ilogic?
Inventor 2013 SP1
Solved! Go to Solution.
Solved by Curtis_Waguespack. Go to Solution.
Okay, First of all you are not making the hinge with ilogic......
You will use ilogic to control which hinge it is used, the quantity and the position.
Sounds like you want to make the Hinge a ipart or iassembly then your 18,22,28,30 and 34" would be members of the factory. This would take care of the number of holes in the hinge
Is the hinge a part or an assembly?
This is where i would start first
Okay. I have my hinge drawn. What do you recommend as my next step? I am going to guess write rules specifing that the 18 in. hinge has 3 holes and they are 6 in. apart and so on. I created it as an iPart and made like 4 more hinges, so are those "rules" already written?
Okay. I have my hinge drawn. What do you recommend as my next step? I am going to guess write rules specifing that the 18 in. hinge has 3 holes and they are 6 in. apart and so on. I created it as an iPart and made like 4 more hinges, so are those "rules" already written?
No, there are no ilogic rulesto write to specify the number of holes etc
Create your ipart factory with all the features that are required in the members for example create it with 4 holes then in each member either suppress or Compute those features in each member.
In the end you will have a number of members which correspond to each of your hinges
no ilogic required
okay..........here goes
Assemble your ipart factory component into your assembly...........you will be prompted to select a member, choose one doesnt matter which right now.
Then stabalize the name in the model tree.........lets imagine you rename it to MyHinge
Then you need to decide what "logic" you are going to use to decide which hinge will be used.
I am going to make an assumption here
lets say you have 3 different hinges SMALL, MEDIUM and LARGE
and the width of the door is the deciding factor as to which hinge to use
So you would have a parameter with the door width value............lets say its named DOOR_WIDTH
There are a few ways the code to swap the hinge member out this is one way
Select Case DOOR_WIDTH
Case 20
iPart.ChangeRow("MyHinge","small")
Case 30
iPart.ChangeRow("MyHinge","medium")
Case 40
iPart.ChangeRow("MyHinge","large")
end select
this link will explain
"How can i use a select case statement"
Not a lot of information to know what is wrong.
Did your ilogic rule for changing out the members run with no errors?
Post your code
What version of Inventor are you using
No that will not work
I think you need this
Select Case Length
Case 18
iPart.ChangeRow("Rolled Barrel Strap Hinge","H-316RB-18")
Case 22
iPart.ChangeRow("Rolled Barrel Strap Hinge","H-316RB-22")
Case 28
iPart.ChangeRow("Rolled Barrel Strap Hinge","H-316RB-28")
Case 30
iPart.ChangeRow("Rolled Barrel Strap Hinge","H-316RB-30")
Case 34
iPart.ChangeRow("Rolled Barrel Strap Hinge","H-316RB-34")
End Select
Can't find what you're looking for? Ask the community or share your knowledge.