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: 

Change part by iLogic in Assembly

13 REPLIES 13
SOLVED
Reply
Message 1 of 14
zdhrichard
4236 Views, 13 Replies

Change part by iLogic in Assembly

Before using iLogic, I created lot of iAssembly and iPart. I could change iPart factory member when I need in iAssembly.

 

Now, I want to move everything to iLogic.

 

My question is: how could I change the part by iLogic code?

 

For example:

I generated "Part1.ipt" and "Part2.ipt",...... (I have hundred of member)

In my assembly, sometimes, I need use Part1.ipt, sometimes I need use Part2.ipt.

Which is the iLogic Code I should to use?

 

Inventor 2009, WIN XP.

Rich

Autodesk Inventor Professional 2018 (64 Bit Edition)
Build: 284, Release 2018.3
Windows 7 Professional Service Pack 1
Intel(R) Xeon(R) CPU E5645
12.0 GB Memory
13 REPLIES 13
Message 2 of 14
jletcher
in reply to: zdhrichard

Working on this myself but you may get more responses in the Autodesk Inventor Customize

 

Message 3 of 14
mrattray
in reply to: jletcher

iParts/iAssemblies do NOT play well with iLogic. You WILL have many many problems.

However, there is a snippet for this in the default snippets of the iLogic editor.

This is the snippet: iPart.ChangeRow("iComponentName:1", "RowMemberName")

Mike (not Matt) Rattray

Message 4 of 14
zdhrichard
in reply to: mrattray

Thanks. But I do not want use any excel in my assembly anymore. I want create everything automaticly.

Rich

Autodesk Inventor Professional 2018 (64 Bit Edition)
Build: 284, Release 2018.3
Windows 7 Professional Service Pack 1
Intel(R) Xeon(R) CPU E5645
12.0 GB Memory
Message 5 of 14
mrattray
in reply to: zdhrichard

Then I don't understand what you're asking.

Mike (not Matt) Rattray

Message 6 of 14
zdhrichard
in reply to: mrattray

Let me explain:

 

Forget iPart and iassembly.

 

I created myPart.ipt with ilogic rule which could generate different parts as part1.ipt, part2.ipt, and so on (Hundreds of them).

 

I created myAssembly.iam with part1.ipt.

 

I want to write some iLogic Rule to change part1.ipt to part2.ipt.

 

Hope I make myself be understand now.

Rich

Autodesk Inventor Professional 2018 (64 Bit Edition)
Build: 284, Release 2018.3
Windows 7 Professional Service Pack 1
Intel(R) Xeon(R) CPU E5645
12.0 GB Memory
Message 7 of 14

Hi  zdhrichard,

 

Something such as this should work for you. Note that you must specify both the part name:

 

 

Component.Replace("Part1:1", "C:\Temp\Part2.ipt", True)

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

Message 8 of 14

Also note:

 

True :  replace all instances of this component 

False  : replace only the single instance that you name Part1:9 replaces only instance 9.

 

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


Message 9 of 14
jletcher
in reply to: mrattray

Sorry but I don't use iparts.. I will make them and generate the files and make a folder called hardware or whatever it is break the link from master ipart. I have found as nice as iparts are they will slow down inventor like you never thought it would.

Message 10 of 14

Great.

 

This is what I want.

 

Thanks lot.

Rich

Autodesk Inventor Professional 2018 (64 Bit Edition)
Build: 284, Release 2018.3
Windows 7 Professional Service Pack 1
Intel(R) Xeon(R) CPU E5645
12.0 GB Memory
Message 11 of 14
Anonymous
in reply to: zdhrichard

HIi!

 

It's possible to replace a part with a iproperties custom name?

 

NEWPART = IProperties.Value("Custom", "MYPART")

Component.Replace("MYPART", "C:MYPART\QU001155_00.ipt", True)

 

Thanks for your help 🙂

Message 12 of 14
mrattray
in reply to: Anonymous

I'm not sure I understand your question. Are you asking if you can use an assembly property to specify the file path and name of a part that you want the rule to replace "MYPART" with? If that's the case then:

 

NEWPART = IProperties.Value("Custom", "MYPART")

Component.Replace("MYPART", NEWPART, True)

This wants NEWPART to be a string containing the full file path.

Mike (not Matt) Rattray

Message 13 of 14
Anonymous
in reply to: Anonymous

"newpart" is the complet file part i want to be replace!

 

Sorry for my english 😞

 

Thanks for your help!

Message 14 of 14
Anonymous
in reply to: Curtis_Waguespack

Hi Curtis,

 

Now suppose those part names and their file paths have been changed in the design assistant is there a way the ilogic rule automatically updates with the new name? 

To be more clear i am looking for a solution for the following 

http://forums.autodesk.com/t5/inventor-general-discussion/update-ilogic-rule-when-filenames-change/m...

 

Thanks,

Sid

using inventor 2011

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

Post to forums  

Autodesk Design & Make Report