Changing name of parts in assembly using i-logic

Changing name of parts in assembly using i-logic

Anonymous
Not applicable
1,547 Views
3 Replies
Message 1 of 4

Changing name of parts in assembly using i-logic

Anonymous
Not applicable

Hello,


I have a query regarding renaming of components in assembly.
Consider, I have assembly say XYZ.iam which consists of 3 parts say A-01.ipt, A-02.ipt, A-03.ipt

I want to write a ilogic code to change prefix from A to B, so that part names will get changed to B-01.ipt, B-02.ipt, B-03.ipt

But, while renaming iLogic rules reference the browser name, NOT the name of the actual part or assembly document underneath it.
So, when you generate BOM in ".idw", after part names will get changed to
B-01.ipt, B-02.ipt, B-03.ipt, you will still see BOM with a list showing A-01.ipt, A-02.ipt, A-03.ipt

So, I would like to write a ilogic code to change prefix from A to B, so that part names will get changed to B-01.ipt, B-02.ipt, B-03.ipt and I want to see BOM with a changed names.

I had found one code which will rename all solid bodies in part, similarly I would like to rename the ".ipt's " in ".iam"
Please click on link http://inventortrenches.blogspot.in/2012/02/ilogic-to-rename-all-solid-bodies.html to get more information on this code.

Please do needful.

0 Likes
1,548 Views
3 Replies
Replies (3)
Message 2 of 4

rjay75
Collaborator
Collaborator

You can't rename the actual file names of the part from the assembly while the assembly is open. In order to do what you want to achieve you would need to open the assembly, collect all the referenced document names that matches the pattern you want and store them. Then close the assembly and any referenced files that are opened, rename the files, reopen the assembly in a mode to not display errors, then replace all the old components with the newly renamed file names.

 

Sounds kind of like you're doing a Copy Design similar to that found in the vault. If so you can achieve this via Design Assistant application installed with Inventor.

 

I also have a vba project that will do a basic in place copy design on an open assembly that will do this also that I can share if you need it.

0 Likes
Message 3 of 4

Anonymous
Not applicable

Hello,

 

Thanks for your reply. Sound like I have to use design assistant.

Even I can make use of i-Logic Design copy as well.

Instead of renaming components,I will enter STOCK NUMBER iproperty  or any custom iproperty of every component in assembly, let us say A-01, A-02, A-03 and so on.

I want to write a ilogic code to change prefix from A to B, so that STOCK NUMBER iproperty or any custom iproperty will get changed to B-01,B-02, B-03 and so on.

Is it possible?

Please let me know

0 Likes
Message 4 of 4

MechMachineMan
Advisor
Advisor
Yes, changing iProperties is very easy with iLogic. Check out this blog for a start:

http://modthemachine.typepad.com/my_weblog/2010/02/accessing-iproperties.html

--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes