Rename frame generator part number to equal file name - iLogic

Rename frame generator part number to equal file name - iLogic

allan.kallaste
Explorer Explorer
1,409 Views
3 Replies
Message 1 of 4

Rename frame generator part number to equal file name - iLogic

allan.kallaste
Explorer
Explorer

We use the frame generator file naming defaults to create custom file names and need to ensure that the file name is the same as the part number. Looking for an iLogic rule to run before save to update the part number. The following rule works, but looking to update only the frame generator parts.

There is a option to deselect "Use part number from content center" but this is set to ON by default and is always missed.

'set top level part number
iProperties.Value("Project", "Part Number") = _
ThisDoc.FileName(False) 'False = without extension

'set each component part number
Dim docFile As Document
For Each docFile In ThisApplication.ActiveDocument.AllReferencedDocuments
	docName0 = docFile.FullFileName
	docName1 = System.IO.Path.GetFileName(docName0)
	docName2 = System.IO.Path.GetFileNameWithoutExtension(docName0)
	iProperties.Value(docName1, "Project", "Part Number") = docName2
Next

 

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

Tony_Yates
Advocate
Advocate
0 Likes
Message 3 of 4

Bram_Baars
Enthusiast
Enthusiast

Better late than never, I came across your post since I'm on my own frame generator quest.

There is a way to deploy that setting, by changing an xml file:

 

https://knowledge.autodesk.com/support/inventor/troubleshooting/caas/sfdcarticles/sfdcarticles/How-t...

Message 4 of 4

Curtis_Waguespack
Consultant
Consultant

For others in the future, see this related link with some examples for renaming FG parts.

 

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

EESignature

0 Likes