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
19743 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 2 of 57
mrattray
in reply to: GH80

I think you'll end up with an even bigger mess then you currently have, and I think the programming required would be quite complex.

Post something up for me to look at and I may be able to make some recomendations.

Mike (not Matt) Rattray

Message 3 of 57
GH80
in reply to: mrattray

Thanks Mike,

 

I will post up an actual example when I get back to work on Monday. The way we do it currently, is first of all create cuts to the sheet metal parts, then add a hardware part into the assembly and constrain it.

 

Rule would be something like:

 

If Deadlock = "Deadlock 1" then

Component.IsActive ("Deadlock 1:1") = True

Component.IsActive ("Deadlock 2:1") = False

Component.IsActive ("Deadlock 3:1") = False

Feature.IsActive......

Constraint.IsActive......

 

ElseIf Deadlock = "Deadlock 2" then ... and so on.

 

Each part has a unique cut for each item, so we just turn them on and off ising Feature.IsActive under the same rule as the hardware items, the same with the constraints.

 

I would like to try a model with just a few generic feature cuts (shape contolled by ilogic that can be used for all hardware items), but would like a way of automatically bringing a part in using ilogic.

 


 

Message 4 of 57
mrattray
in reply to: GH80

I think I'll be able to help you simplify things once you get that model posted. It sounds like you're doing things the hard way.

Mike (not Matt) Rattray

Message 5 of 57
Curtis_Waguespack
in reply to: GH80

Hi GH80,

 

You could use the ComponentOccurrences.Add method to do this:

 

oOcc = oAsmCompDef.Occurrences.Add("C:\Temp\Part1.ipt", oMatrix)

 or use Replace:

 

Component.Replace("Part1:1", "OtherPartfilename.ipt", True)

 

Attached is a quick example that uses each. The exmple is expecting to find the part files in the same folder as the assembly.

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

Message 6 of 57

Inserting the component is the easy part; how would you programmatically constrain the inserted components?

Mike (not Matt) Rattray

Message 7 of 57

Hi mrattray,

 

When configuring something like this I typically try to set up the base configuration so that constraints are not impacted by the replacement.

 

So for this door example, I think I'd create all of my components to have common placement geometry, meaning that Deadlock2 and Deadlock3 would be created by copying Deadlock1 and then modifying them. I might have to do some remodeling for the components if they've not been created like this already, but it'll pay off in the long run.

 

Then I'd constrain to use only geometry that is common. It might be Origin planes or work planes, or it might be a common base extrude or common holes. But the important part is that Inventor sees the same geometry in the both members of the replacement. This generally is not an issue when creating configurations, since the parts are typically in the same "family" of parts.

 

Another approach is to set the base configuration up using more of a skeletal  modeling approach, where a common base geometry is derived into each component.

 

If there is a need to replace "the bolt" with "the battleship" then that takes on a whole new challenge.

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

Message 8 of 57

I tend to work with very large ilogic driven models, this is the methods i use to try and simplify the model and rules

 

Replaceable components----- ones which are either  used or replaced with something else

 

I use iparts (if they are fixed instances) and use the ipart change member ilogic function

Or (for non standard components) I use the Replace component function in ilogic. Note for the replace function to work the components must be placed using imates (i use a composite imate)

Care is needed to keep the imates the same for all replaceable components

 

Finally if i am just suppressing or unsuppressing a component. I have (in very large models) changed the suppress to a replace and use a "dummy" part (no geometry) as the replacement.

This helps to keep the model "lighter"

Inventor 2010 Certified Professional
Message 9 of 57
GH80
in reply to: GH80

Thanks to all for the suggestions. I have a better understanding now about the possibilities. It seems that replace component would work for most cases that I have, using a dummy part with no geometry and replacing it by our selections.

 

Thanks

Message 10 of 57

Dear Sir,

I am trying to place componet automatically by Menu Driven Option in Autodesk Inventor 2011. 

I have used 2-icomposite in each part to insert file into the assembly. 

requirement.png

I have issue in controlling the icomposite, during autoinsertion. 

I would like to control the same by means of suppressing icomposite during insertion of part file and unsuppressing the icomposite after insertion.

 

I have attached the assembly file.

Reqest you to kindly help me in controlling icomposite. 

Regards,

Carthik

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 11 of 57
Carthik_Babu
in reply to: Carthik_Babu

Hi,

I found the answer by refering other site and examples. I have uploaded the same for your reference.

 

http://www.youtube.com/watch?v=aIGCHPAUhD8&feature=youtu.be

 

hope it will be useful.

 

Regards,

Carthik Babu 

 

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 12 of 57
jwood14
in reply to: Carthik_Babu

I have a similar question. I am building a door that can be varied in size, and I need the width to determine which hinge product to use. At the moment I have about 6 hinges in the same starting place, but the other side changes in length (due to the different product. I am wondering if I can simplify this code instead of having a hundred lines, if I can tell iLogic to replace the hinge (the alloted hinge determined by the door width) and place the fixed end in relation to the corner of the door., If I can get some direction, I should be okay... I just learned how to use excel to modify the door's dimentions, so I am completely green. So far my best and only tudor is youtube haha., thanks!

Message 13 of 57
swordmaster
in reply to: jwood14

There are most likely several ways to achieve what you are trying to do, none of which would need hundreds of lines of ilogic code.

To swap out the hinge you can use either the ilogic REPLACE function or the IPARTCHANGE ROW function

This depends on whether your hinges are individual components or a Ipart factory. Actually they can also be a Iassembly ( if its modeled in seperate pieces)

The decision of when to swap out can be controlled by the value of your door width parameter.

For the placement position I would constrain the hinges using work features and drive the position of these based on your door size

Inventor 2010 Certified Professional
Message 14 of 57
GH80
in reply to: Carthik_Babu

I have used replace component to change hinges on a door model. I placed a standard hinge in place, but I found I needed to rename the hinge to a generic name (eg Hinge1) to get the rule below to work correctly. I have the hinges operating on a drop down box, but this could be controlled by width or height also. PS the parameter dimensions are for different hinge cut-outs on the leaf & frame parts.

If CustomHinge = "Standard" Then

Component.Replace("Hinge:1", "102 x 76mm SS Hinge.iam", True)
Component.Replace("Hinge:2", "102 x 76mm SS Hinge.iam", True)
Component.Replace("Hinge:3", "102 x 76mm SS Hinge.iam", True)
Component.Replace("Hinge:4", "102 x 76mm SS Hinge.iam", True)
Component.Replace("Hinge:5", "102 x 76mm SS Hinge.iam", True)
Component.Replace("Hinge:6", "102 x 76mm SS Hinge.iam", True)
Component.Replace("Hinge:13", "102 x 76mm SS Hinge.iam", True)
Component.Replace("Hinge:14", "102 x 76mm SS Hinge.iam", True)

Parameter("Active Base:1", "HingeL") = 102 mm
Parameter("Active Base:1", "HingeD") = 29.4 mm
Parameter("Inactive Base:1", "HingeL") = 102 mm
Parameter("Inactive Base:1", "HingeD") = 29.4 mm
Parameter("DRHinge Jamb LH:1", "HingeL") = 102 mm
Parameter("DRHinge Jamb LH:1", "HingeD") = 31 mm
Parameter("DRHinge Jamb LH:1", "HingeCut") = 3.6 mm
Parameter("DRHinge Jamb RH:1", "HingeL") = 102 mm
Parameter("DRHinge Jamb RH:1", "HingeD") = 31 mm
Parameter("DRHinge Jamb RH:1", "HingeCut") = 3.6 mm
d16 = 8.746 mm
d10 = 8.746 mm


ElseIf CustomHinge = "IVES 5 x 4.5" Then

Component.Replace("Hinge:1", "5BB1HW 5X4.5 NRP SS Hinge.iam", True)
Component.Replace("Hinge:2", "5BB1HW 5X4.5 NRP SS Hinge.iam", True)
Component.Replace("Hinge:3", "5BB1HW 5X4.5 NRP SS Hinge.iam", True)
Component.Replace("Hinge:4", "5BB1HW 5X4.5 NRP SS Hinge.iam", True)
Component.Replace("Hinge:5", "5BB1HW 5X4.5 NRP SS Hinge.iam", True)
Component.Replace("Hinge:6", "5BB1HW 5X4.5 NRP SS Hinge.iam", True)
Component.Replace("Hinge:13", "5BB1HW 5X4.5 NRP SS Hinge.iam", True)
Component.Replace("Hinge:14", "5BB1HW 5X4.5 NRP SS Hinge.iam", True)

Parameter("Active Base:1", "HingeL") = 128 mm
Parameter("Active Base:1", "HingeD") = 37 mm
Parameter("Inactive Base:1", "HingeL") = 128 mm
Parameter("Inactive Base:1", "HingeD") = 37 mm
Parameter("DRHinge Jamb LH:1", "HingeL") = 128 mm
Parameter("DRHinge Jamb LH:1", "HingeD") = 38 mm
Parameter("DRHinge Jamb LH:1", "HingeCut") = 5 mm
Parameter("DRHinge Jamb RH:1", "HingeL") = 128 mm
Parameter("DRHinge Jamb RH:1", "HingeD") = 38 mm
Parameter("DRHinge Jamb RH:1", "HingeCut") = 5 mm

d16 = 21 mm
d10 = 21 mm

ElseIf CustomHinge = "IVES 4.5 x 4.5" Then

Component.Replace("Hinge:1", "5BB1HW 4.5X4.5 NRP SS Hinge.iam", True)
Component.Replace("Hinge:2", "5BB1HW 4.5X4.5 NRP SS Hinge.iam", True)
Component.Replace("Hinge:3", "5BB1HW 4.5X4.5 NRP SS Hinge.iam", True)
Component.Replace("Hinge:4", "5BB1HW 4.5X4.5 NRP SS Hinge.iam", True)
Component.Replace("Hinge:5", "5BB1HW 4.5X4.5 NRP SS Hinge.iam", True)
Component.Replace("Hinge:6", "5BB1HW 4.5X4.5 NRP SS Hinge.iam", True)
Component.Replace("Hinge:13", "5BB1HW 4.5X4.5 NRP SS Hinge.iam", True)
Component.Replace("Hinge:14", "5BB1HW 4.5X4.5 NRP SS Hinge.iam", True)

Parameter("Active Base:1", "HingeL") = 115.5 mm
Parameter("Active Base:1", "HingeD") = 37 mm
Parameter("Inactive Base:1", "HingeL") = 115.5 mm
Parameter("Inactive Base:1", "HingeD") = 37 mm
Parameter("DRHinge Jamb LH:1", "HingeL") = 115.5 mm
Parameter("DRHinge Jamb LH:1", "HingeD") = 38 mm
Parameter("DRHinge Jamb LH:1", "HingeCut") = 5 mm
Parameter("DRHinge Jamb RH:1", "HingeL") = 115.5 mm
Parameter("DRHinge Jamb RH:1", "HingeD") = 38 mm
Parameter("DRHinge Jamb RH:1", "HingeCut") = 5 mm

d16 = 21 mm
d10 = 21 mm



End If

 

Message 15 of 57
swordmaster
in reply to: GH80

Yes you need to "stabalize" the name of the component that will be replaced

To do this find the component in the model tree and right vlick on it twice(slowly) the name will be highlighted and you can then rename it.

 

Below is a extract from the help file on stabalizing the name

 

 Replace one part or subassembly with another by specifying the component name of the part to replace and the part file name of the part to replace it with."True" or "False" specifies whether to replace all or only a single instance of the component being replaced.

   NOTE:  Before using this function you should "stabilize" the name of the component so that it doesn't change when the swap occurs.  Do this by changing the name of the component.  (You can actually change it once, and then change it back to the original name.)  If you don't do this, the replace operation will change it to match the different part name.  Then the rule will be unable to find the component when it runs again.

  Use iMates in components being swapped to keep the assembly constraints intact. It is possible to swap a part for a part, a part for an assembly or an assembly for a part.

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

I will need the part number to change..... This is all so much to take in. I had hopes of being able to do al of this eventually, but the time has come for me to learn. I feel my brain is going to explode because there is so much to take in. I am almost completely self taught since high school ( inventor 2007, sophomore year) and only that year. I thought I was decently prepared... but I am not sure I could have been much more wrong! Smiley Frustrated

Message 17 of 57
jwood14
in reply to: jwood14

Not to mention, I've got no real idea what I am doing. Like i said before, my training  for the more advanced things is Youtube. So I dont really understand the language or the reason behind the programming... I feel like I am wasting your all's time.

Message 18 of 57
GH80
in reply to: Carthik_Babu

Don't give up! I would be stuck without a helping hand from either youtube, colleagues or these forums 🙂 Try and break everything down in small steps. Eg a rule to change a parameter depending on door size. Then try looking at a very simple component replace on a test part. Keep building it up, you will be there in no time.

Message 19 of 57
jwood14
in reply to: GH80

Ok. Lets start with making a hinge in iLogic. I have made an 18" hinge, and I need to make it a 22", 28", 30", and 34". With the exception of the 18", they all have 4 bolt holes (18 has 3), same size but different distances. How do I tell I logic hhow many and how far apart?

Message 20 of 57
swordmaster
in reply to: jwood14

"i WILL NEED THE PART NUMBER TO CHANGE"

Stabalizing the name DOES NOT stop the part number from changing! Remember you stabalize the name in the assembly model tree. The component itself is not renamed (if that makes sense)

 

Think of it like this

You have code which says "replace PART A with PART B"

So first time you run the code it replaces PART A with PART B...............GREAT!!!

Second time you run the code it fails because PART A is no longer in the assembly

 

So by "stabalizing the name in the model tree and using THAT NAME in the code means  that it will work EVERYTIME

Inventor 2010 Certified Professional

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

Post to forums  

Autodesk Design & Make Report