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.
Oops, i hope there is some problem with community mailer. I got all these update in single day ie today (29 mail for this same Topic).
Well, u got help from Swordmaster. Just pinging the below link, may be useful.
http://wikihelp.autodesk.com/Inventor/enu/2012/Help/0073-Autodesk73/0673-iLogic673/0675-Conditio675
Ha ha opps
I would like to thank you all for all of the help you have given me. You have shown me that there is another place I can turn to other than Youtube.
I have tried a few things, but I am still getting the erroe message
"Error in rule: strap_size, in document: Rolled Barrel Strap Hinge.ipt
Object reference not set to an instance of an object."
I have no idea how to set the reference to an "instance" of my hinge
"Rolled Barrel Strap Hinge.ipt" this is your ipart correct?
If so the code to swap out the ipart member goes in your assembly not the ipart
First off, answer this question
where did you place the ilogic code for swapping out the ipart members
Is it in the ipart or your assembly?
good , thats where it needs to be
I think you need to do a simple test of your code first before going furher with your "real" model
create a assembly
create a parameter in the assembly named Length
Insert your hinge ipart (select any member)
Stabalize the name of the Hinge by renaming it in the model tree of the assembly
create a ilogic rule in your assembly
Insert the code for swapping out the hinge member
save everything!
now try changing the value of the Length parameter in the assembly (select from your values 18,22 etc)
the hinge should swap out when the rule is ran
@Anonymous @Curtis_Waguespack
I have similar kind of question, I have an excel where all occurances name are given (ipt and iam) . Could you please help me to get insert the part/assembly reading from the excel list?
your help will be highly appriciated.
Hi @bhavik4244
It would probably be best for you to provide an small example file set (inventor files and excel ), and mention which version of Inventor you are using, and then someone can likely provide an example.
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
I don't think anyone has mentioned the easiest way of doing this.
You should use the manage command.
ThisAssembly.BeginManage("Group 1") If (addCompB) Dim componentB = Components.Add("occName", "b.ipt", position := Nothing, grounded := False, visible := True, appearance := Nothing) End If ThisAssembly.EndManage("Group 1")
Group 1 can be anything, so you could have door 800, door 1200, door 1500.
Then you can use the standard code above, or you can place the mates instead.
First method using location which you can get from
ThisAssembly.BeginManage("Door 800")
If Width > 750 and If Width < 950 Dim componentA = Components.Add("occName", "a.ipt", position := Nothing, grounded := False, visible := True, appearance := Nothing) End If ThisAssembly.EndManage("Door 800")
ThisAssembly.BeginManage("Door 1000")
If Width > 950 and If Width < 1500
Dim componentA = Components.Add("occName", "a.ipt", position := Nothing, grounded := False, visible := True, appearance := Nothing)
End If
ThisAssembly.EndManage("Door 1000")
Second method:
The way I do it is to put everything in that I need, mate it all and then right click the parts in the assembly tree in the iLogic dialogue and select
You'll end up with something like this:
The first method is a bit messy, and will ground all your components, the second will mate them. It's usually best to fix the names in the browser as mentioned in one of the other replies first.
Using the manage command will add and remove parts as necessary. No suppression messing things up. You need these parts on your hard drive first though, so you either need ilogic code to get from vault, or you need to manually get them.
Can't find what you're looking for? Ask the community or share your knowledge.