SHOW BOTH PART NUMBER & BROWSER NAME IN DESIGN TREE ?

SHOW BOTH PART NUMBER & BROWSER NAME IN DESIGN TREE ?

Anonymous
Not applicable
1,464 Views
6 Replies
Message 1 of 7

SHOW BOTH PART NUMBER & BROWSER NAME IN DESIGN TREE ?

Anonymous
Not applicable

As a former Solidworks user I am trying to find a way to show BOTH the part number and the renamed browser name in the design tree.

I know I can switch back and forth between the two but would like to see both .

 

Thanks

Steven

0 Likes
1,465 Views
6 Replies
Replies (6)
Message 2 of 7

Mark.Lancaster
Consultant
Consultant

You would need an iLogic program to do that..  Here's an example I did years ago to show plate stock size as the display name.  It would also update (iLogic Trigger) before a save of the file.

 

12-8-2015 1-24-44 PM.jpg

 

Edit:  Do you know how to use iLogic within Inventor?  (also I'm assuming you have a new version of Inventor, where iLogic is built into it - older versin required an add-on).

Mark Lancaster


  &  Autodesk Services MarketPlace Provider


Autodesk Inventor Certified Professional & not an Autodesk Employee


Likes is much appreciated if the information I have shared is helpful to you and/or others


Did this resolve your issue? Please accept it "As a Solution" so others may benefit from it.

0 Likes
Message 3 of 7

Anonymous
Not applicable

Thanks, yes i know ilogic. But doesnt this just add info from part to browswer name?

maybe this will help, I have parts that I named in the browser side flange, top flange door...ect..but the file names are sht.00001234.ipt.

I would like to see both in the browser tree

0 Likes
Message 4 of 7

Mark.Lancaster
Consultant
Consultant

Yes that ilogic snippet is pulling data from the part.  It was just an exmaple (assuming you would modify it to meet your requirements).

 

Here's a quick one that I did based on your requirements..  I wasn't sure if you wanted file name or part number..  Since you indicated in one posting part number but in another one you said file name.  This one combines the current display name with the file name + ext.

 

12-8-2015 1-55-40 PM.jpg

Mark Lancaster


  &  Autodesk Services MarketPlace Provider


Autodesk Inventor Certified Professional & not an Autodesk Employee


Likes is much appreciated if the information I have shared is helpful to you and/or others


Did this resolve your issue? Please accept it "As a Solution" so others may benefit from it.

0 Likes
Message 5 of 7

Anonymous
Not applicable

thanks that worked for the assembly name.

can i modify it to show the same  info for the parts of the assembly?

2015-12-08_13-16-25.jpg

as you can see in the bottom half i didnt change the browswer names..the top half i did so i can find the in the assembly easier.

i would like to see the file name next to the browser new name.

 

Thanks again for the help

0 Likes
Message 6 of 7

Mark.Lancaster
Consultant
Consultant

It all depends on if you want to change the browser name of the individual parts at the assembly level or the part level.

 

If you change the individual part browser names at the assembly level you are only changing it in that assembly.

 

If you make the change at the part level than its across the board.

 

So at the part level you can use that same iLogic code.

 

If at the assembly level, that would require additional coding to loop through the entire model structure.

Mark Lancaster


  &  Autodesk Services MarketPlace Provider


Autodesk Inventor Certified Professional & not an Autodesk Employee


Likes is much appreciated if the information I have shared is helpful to you and/or others


Did this resolve your issue? Please accept it "As a Solution" so others may benefit from it.

0 Likes
Message 7 of 7

MechMachineMan
Advisor
Advisor

Hi.

 

Here is a vb.net routine I wrote that can be used as an external rule to accomplish such a feat from the assembly level:

 

Note: the plethora of checks are required so that it doesn't go through library parts or STANDARD content center parts renaming browser nodes..

 

Option Compare Text
Imports System.IO

Public Sub Main()
    Dim asmDoc As AssemblyDocument
    asmDoc = ThisApplication.ActiveDocument
    
    asmDoc.DisplayName = BuildName(asmDoc)
    

    Dim doc As Document
    For Each doc In asmDoc.AllReferencedDocuments
		doc = ThisApplication.Documents.Open(doc.FullFileName, False)

		For Each oLibPath In ThisApplication.DesignProjectManager.ActiveDesignProject.LibraryPaths
			If (doc.FullFileName Like "*" & oLibPath.Path & "*")
				oDONOTTOUCH = True
			End If	
		Next		 

		Dim fInfo As New FileInfo(doc.FullFileName)
		If (doc.FullFileName Like "*Content*")  Or (doc.IsModifiable = False) Or (fInfo.IsReadOnly)
			oDONOTTOUCH = True	 
		End If
		
		'If Not doc.PropertySets.Item("Design Tracking Properties").Item("PartNumber").Value Like "#-#-#"
		'	oDONOTTOUCH = True
		'End If


		If oDONOTTOUCH = True
		Else
			If Not (doc.FullFileName Like ThisApplication.DesignProjectManager.ActiveDesignProject.WorkspacePath & "*")
				If MsgBox(doc.FullFileName & " not found in workspace!" & vbLf & vbLf & "Continue?", MsgBoxStyle.YesNo) = MsgBoxResult.No
					doc.ReleaseReference
					Continue For
				End If
			End If
		End If

		If oDONOTTOUCH = False
		Try
        		doc.DisplayName = BuildName(doc)
		Catch
			'MsgBox(doc.FullFileName)
		End Try
		End If

		doc.ReleaseReference

    Next
End Sub

Private Function BuildName(doc As Document) As String
    Dim name As String
    Dim designTrackProps As PropertySet
    designTrackProps = doc.PropertySets.Item("Design Tracking Properties")
    
	If designTrackProps.Item("Part Number").Value Is Nothing
		BuildName = doc.DisplayName
	Else
    name = designTrackProps.Item("Part Number").Value & " - [" & _
           designTrackProps.Item("Description").Value & "]"
           
    BuildName = name
	End If
End Function

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