select i parts using i logic

select i parts using i logic

simonford026
Contributor Contributor
449 Views
5 Replies
Message 1 of 6

select i parts using i logic

simonford026
Contributor
Contributor

Hi

 

I am working on my first Inventor project and i want to know if its possible to use i logic to select the correct i part member depending on parameters set in a assembly? 

 

If yes does anyone have any examples or guidance i can look at to get a idea how to do this.

0 Likes
450 Views
5 Replies
Replies (5)
Message 2 of 6

JelteDeJong
Mentor
Mentor

have a look at this rule:

If (MyParameter < 10) Then
	iPart.ChangeRow("iComponentName:1", "RowMemberName1")
Else
	iPart.ChangeRow("iComponentName:1", "RowMemberName2")
End If

 It uses the parameter "MyParameter" to set an iPart  "iComponentName" to the member "RowMemberName1" or "RowMemberName2"

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

0 Likes
Message 3 of 6

simonford026
Contributor
Contributor

Thank you very much for that example. 

 

I think it might be a little long winded for what i am trying to achieve. 

 

I have  a part that i need to turn several features on / off depending on the assembly in which it is placed. I could easily end up with 100 variations of this part.

 

I currently have a master part with features being turned on/off that is being driven by the final assembly. If i use a copy design function or place i logic component this will create a new unique instance of that part, is this correct?

 

What i want to achieve is when the assembly parameters match a existing part it places that existing part instead of creating a new part. 

 

I can see how this works in your example but i fear this would end up as a very long i logic code prone to error. 

 

my idea was to create the i parts and then use i logic to place the correct version in the assembly. 

 

0 Likes
Message 4 of 6

A.Acheson
Mentor
Mentor

iPart

If you could come up with a naming scheme for your iPart member name that equates to certain conditions you could access that directly with member change logic.

Alternately look into the factory part with parameter as column name and check if matches conditions and place member that matches. 


Placing an iLogic component assembly/part will always create a new modifiable instance and save to a location of choice. What you could do is to modify the filename after creation or *before* and then check if another one is existing in the same folder under that given name. 


* Not sure this is possible to do with post private as Inventor does naming with next index number. 

An alternate might be to check first if the file with your wanted parameters exist in a given folder if not use place ilogic component to open the dialogue for you in order to create one. I am not sure if you can input the parameters at the time of opening the ilogic component by code. 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 5 of 6

simonford026
Contributor
Contributor

Is it possible to drive the assembly parameters from the part? 

 

It may work for me if I can chose a i part member that then alters the rest of the assembly to suit. 

0 Likes
Message 6 of 6

A.Acheson
Mentor
Mentor

There is multiple ways you could do this. If going the ipart route you will need to query the ipart factory table. 

Here is the link to the help files. You will need to find the column with your parameter then loop through the rows for your value.

 

Ilogic snippet warning:

The ilogic snippets have change member row per parameter. These will change immeditaley however if you have multiple parameters you may find it difficult to change the members. This is why you may need to query the table directly then change member only after you have all your conditions met. 

 

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes