iLogic - Bulk Feature Browser Rename

iLogic - Bulk Feature Browser Rename

jason_snyder
Enthusiast Enthusiast
808 Views
6 Replies
Message 1 of 7

iLogic - Bulk Feature Browser Rename

jason_snyder
Enthusiast
Enthusiast

Hi All,

I'm currently looking for a solution to bulk rename browser items.

 

I've attached photo showing how to rename one at a time. However, this is time consuming as I have 300-400 to go.

 

I have a excel spread sheet marrying current name to future name. Cell A1 = Work Plane 88, Cell B1 = WP88 etc. 

 

Does anyone have code so I can quickly rename the rest of my 300-400 work planes via my spread sheet?   

 

Cheers

 

0 Likes
Accepted solutions (1)
809 Views
6 Replies
Replies (6)
Message 2 of 7

mcgyvr
Consultant
Consultant

You will just need to do a loop (for each) through each workplane name and use excel find row to find the one matching your workplane name then change the name to the cell next to it..

See if you can figure it out from here..

https://knowledge.autodesk.com/support/inventor-products/learn-explore/caas/CloudHelp/cloudhelp/2015...

 

If not please post your excel file and ipt file and someone can whip something up for you.. 

 



-------------------------------------------------------------------------------------------
Inventor 2023 - Dell Precision 5570

Did you find this reply helpful ? If so please use the Accept Solution button below.
Maybe buy me a beer through Venmo @mcgyvr1269
Message 3 of 7

Curtis_Waguespack
Consultant
Consultant
Accepted solution

Hi jason.snyder,

 

I don't have the time to  include the Excel part of this, but here is a quick example of how to rename all work planes (skipping the origin planes).

 

Also just as a tip, you can search and ask programming questions of this type on the Inventor Customization forum too:
http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/bd-p/120

 

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

 

oDoc = ThisApplication.activedocument
i = 1
For Each oWorkPlane In oDoc.ComponentDefinition.WorkPlanes
	'skip origin planes
	If oWorkPlane.IsCoordinateSystemElement = False Then 
	oWorkPlane.Name = "WP" & i
	i=i+1
	End If
Next

 

EESignature

Message 4 of 7

Curtis_Waguespack
Consultant
Consultant

Another option:

 

oDoc = ThisApplication.activedocument
i = 1
For Each oWorkPlane In oDoc.ComponentDefinition.WorkPlanes
	'skip origin planes
	If oWorkPlane.IsCoordinateSystemElement = False Then 
	oWorkPlane.Name = oWorkPlane.Name.Replace("Work Plane", "WP")
	End If
Next

EESignature

Message 5 of 7

mcgyvr
Consultant
Consultant

Great examples from Curtis (again.. of course)...

Assuming that the naming is as simple as Work Plane 88 to WP88 then no excel is needed...



-------------------------------------------------------------------------------------------
Inventor 2023 - Dell Precision 5570

Did you find this reply helpful ? If so please use the Accept Solution button below.
Maybe buy me a beer through Venmo @mcgyvr1269
0 Likes
Message 6 of 7

jason_snyder
Enthusiast
Enthusiast

Thanks Curtis,

 

Both your codes work perfectly, However, just one more question ...

 

How do I get the end number in the rename to increment? Instead of going 1,2,3,4 etc, I want say 0,5,10 etc.

 

I thought where i = i+1 you'd have i = i+5, though this comes with an error. Any thoughts?

 

Cheers  

0 Likes
Message 7 of 7

jason_snyder
Enthusiast
Enthusiast

Disregard previous, I found the error.

 

To get the i = i+5 working I had to alter the "WP" in this line: oWorkPlane.Name = "WP" & i. & then re-run.  

 

All works. Thanks again Curtis. So speedy now.

 

Cheers,

Jason Snyder

0 Likes