Custom fields in model tree (i.e. not part number/file name)

Custom fields in model tree (i.e. not part number/file name)

IC96
Participant Participant
3,404件の閲覧回数
7件の返信
メッセージ1/8

Custom fields in model tree (i.e. not part number/file name)

IC96
Participant
Participant

Hello,

 

My company uses a randomly generated number for parts and file names. When I'm in an assembly the model tree is just a list of numbers, it can get confusing.

 

Is there a way to have Inventor display the title of the part in the model tree instead of part number/file name?

 

Running Inventor 2018

 

Cheers

0 件のいいね
解決済み
3,405件の閲覧回数
7件の返信
返信 (7)
メッセージ2/8

Cadmanto
Mentor
Mentor

Not out of the box, but this thread might help you in getting the description to show up in the browser.

https://forums.autodesk.com/t5/inventor-forum/displaying-part-description-in-feature-tree/td-p/63507...

 


Windows 10 x64 -16GB Ram
Intel i7-6700 @ 3.41ghz
nVidia GTS 250 - 1 GB
Inventor Pro 2020

 

Best Regards,
Scott McFadden
(Colossians 3:23-25)


メッセージ3/8

swalton
Mentor
Mentor

I don't think that there is a way out-of-the-box to change a component's display name from either its filename or part number to its description.

 

iLogic to the rescue!?

 

This thread may give you a good start:

https://forums.autodesk.com/t5/inventor-forum/changing-occurrence-name-for-multiple-parts/td-p/54096...

 

You might want to post your question in the Inventor Customization forum.

 

I think it is a good idea to keep the part number/filename as part of your new display name.  I would get very lost in an assembly that did not keep that information in front of me.

Steve Walton
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


Inventor 2025
Vault Professional 2025
メッセージ4/8

Curtis_Waguespack
Consultant
Consultant
解決済み

Hi @IC96 

 

To do this for all occurrences in the assembly you can use something like this example ilogic code. 

 

This rule catches errors when the title iproperty is empty, and it also adds an instance number with a colon, so that no errors occur from trying to name multiple occurrences of the same part the same thing.

 

Note I would make this an external rule and run it on the assembly...  and you might set it to run on the 'Before Save' event trigger.

 

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

 

Dim oAssyDoc As AssemblyDocument
oAssyDoc = ThisApplication.ActiveDocument
Dim oAsmCompDef As AssemblyComponentDefinition
oAsmCompDef = oAssyDoc.ComponentDefinition
Dim oOcc As ComponentOccurrence

i=1
For Each oOcc In oAsmCompDef.Occurrences.AllLeafOccurrences
		Try
		oOcc.Name = iProperties.Value(oOcc.Name, "Summary", "Title") & ":" & i
		Catch
		'catch errors ( such as empty title iprop value ) and do nothing
		End Try
		
		i=i+1
Next

EESignature

メッセージ5/8

Curtis_Waguespack
Consultant
Consultant

@swalton wrote:

I think it is a good idea to keep the part number/filename as part of your new display name.  I would get very lost in an assembly that did not keep that information in front of me.


 

 

This is a good point, maybe something like this to toggle between Title and Part Number would be best:

 

oInput = InputRadioBox("Set browser names as?", "Title", "Part Number", True, "iLogic")

Dim oAssyDoc As AssemblyDocument
oAssyDoc = ThisApplication.ActiveDocument
Dim oAsmCompDef As AssemblyComponentDefinition
oAsmCompDef = oAssyDoc.ComponentDefinition
Dim oOcc As ComponentOccurrence

i=1
For Each oOcc In oAsmCompDef.Occurrences.AllLeafOccurrences

	If oInput = True Then 
		sText = iProperties.Value(oOcc.Name, "Summary", "Title")
	Else
		sText = iProperties.Value(oOcc.Name, "Project", "Part Number")
	End If

	Try
	oOcc.Name = sText  & ":" & i
	Catch
	'catch errors ( such as empty title iprop value ) and do nothing
	End Try
	
	i=i+1
Next

 

EESignature

メッセージ6/8

IC96
Participant
Participant

Thanks mate, this is exactly what I was after

2019-06-07 09_13_21-Autodesk Inventor Professional 2018.png

メッセージ7/8

Anonymous
適用対象外

Hello,

 

I was looking for this solution but I am having trouble running the macro.

 

Could someone please assist me running this macro or i logic rule?

 

I dont know how.

 

Thanks!

0 件のいいね
メッセージ8/8

johnsonshiue
Community Manager
Community Manager

Hi! Another option is to install an existing app. Please take a look at the following browser related apps.

 

https://apps.autodesk.com/INVNTOR/en/List/Search?isAppSearch=True&searchboxstore=INVNTOR&facet=&coll...

 

Many thanks!



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer