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: 

ilogic part insertion

56 REPLIES 56
SOLVED
Reply
Message 1 of 57
GH80
19641 Views, 56 Replies

ilogic part insertion

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

 

 

56 REPLIES 56
Message 41 of 57
Carthik_Babu
in reply to: jwood14

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/2014/Help/1283-Inventor1283/3538-iLogic3538/3543-Function3...

 

http://wikihelp.autodesk.com/Inventor/enu/2012/Help/0073-Autodesk73/0673-iLogic673/0675-Conditio675

Carthik Babu M.S, Asst Manager - Machine Building,
Gabriel India Ltd,Hosur, TN, INDIA
Email:carthik_ms@yahoo.co.in ,
https://grabcad.com/carthik-1/projects
"May all beings be happy" http://www.dhamma.org/
Message 42 of 57
jwood14
in reply to: Carthik_Babu

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

Message 43 of 57
swordmaster
in reply to: jwood14

"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

 

Inventor 2010 Certified Professional
Message 44 of 57
jwood14
in reply to: swordmaster

Yes, that is my part number. What is the ipart number? the case number? Would you be able to give me an example?
Message 45 of 57
swordmaster
in reply to: Carthik_Babu

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?

Inventor 2010 Certified Professional
Message 46 of 57
jwood14
in reply to: swordmaster

in the part.... but I just moved it over to the assembly
Message 47 of 57
swordmaster
in reply to: jwood14

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

Inventor 2010 Certified Professional
Message 48 of 57
jwood14
in reply to: swordmaster

ok, I tried to place the 22 inch and the 18 showed up, is that right?
Message 49 of 57
swordmaster
in reply to: jwood14

you tell me! is that the result you want?
Inventor 2010 Certified Professional
Message 50 of 57
jwood14
in reply to: swordmaster

oh duh! No it is not, I need it to change with the door's width, I think I have that figured out though how to tell it that if a door is between a certain range what size to pick. But no, the 22 in is supposed to show up


-Jonathon Wood A-101
Message 51 of 57
swordmaster
in reply to: jwood14

"oh duh! No it is not"
If it was that obvious why ask me if it was correct?
I really did not appreciate that remark. You need to test your own code
Inventor 2010 Certified Professional
Message 52 of 57
jwood14
in reply to: swordmaster

I'm sorry, I selected the 22" from the table list but the 18 inch came up, but I don't know why. That's not coding though is it? I told the program what each hinge was according to length and the number of holes it received, at what spacing.


-Jonathon Wood A-101
Message 53 of 57
jwood14
in reply to: jwood14

The 18" is the only one that shows, even though I am able to select the other 5 sizes
Message 54 of 57
bhavik4244
in reply to: swordmaster

@swordmaster @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.


Bhavik Suthar
Message 55 of 57
Curtis_Waguespack
in reply to: GH80

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

Message 56 of 57
SharkDesign
in reply to: GH80

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 

ilo3.PNG

 

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 

ilo.PNG

 

You'll end up with something like this:

ilo2.PNG

 

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. 

  Expert Elite
  Inventor Certified Professional
Message 57 of 57

@Curtis_Waguespack 

 

thanks for your reply. I have manage to solve my issue.


Bhavik Suthar

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

Post to forums  

Autodesk Design & Make Report