Browser note on all Level

Browser note on all Level

Darkforce_the_ilogic_guy
Advisor Advisor
228 Views
3 Replies
Message 1 of 4

Browser note on all Level

Darkforce_the_ilogic_guy
Advisor
Advisor

I have a problem with sometimes Browser note , does not show the right thing.  is that a fast way to make sure that browser note always show the right thing.  the right thing in this case is what it will show you if you

 delete the browser note... in part it will userly be the same as the part nummer.  Like this 

Darkforce_the_ilogic_guy_0-1700658788882.png

or like this in assembly

Darkforce_the_ilogic_guy_1-1700658891139.png

Darkforce_the_ilogic_guy_2-1700658907996.png

I need it show the right think all files and on all level in the browser note

 

I have try to fix it with ilogic code ...but none of my code does not seens to fix all types.. and if I force it to reset all browser note all the time .. if will because too slow ... but other code I have made so far .seems to skip some and need to be reset  no matter what I do.

 

 

 

 

 

0 Likes
229 Views
3 Replies
Replies (3)
Message 2 of 4

WCrihfield
Mentor
Mentor

Hi @Darkforce_the_ilogic_guy.  As far as I know, that is just showing the Document.DisplayName property value, which is a Read/Write String.  But there is also a Document.DisplayNameOverridden property, which is also a Read/Write Boolean, and if its current value is True, you can change it to False to restore the 'default' DisplayName.  You may simply be able to batch process multiple files, making sure their DisplayNameOverridden property is set to False, then save the file.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 3 of 4

Darkforce_the_ilogic_guy
Advisor
Advisor

I don´t know why , but that does not always work,  Somthing it false even when it is change

 

I am Currently using this code 

Sub Main()

Try
debug("Start ilogic: RenameBrowsernoteAll")

oDoc = ThisDoc.Document
Dim oPane As BrowserPane
Dim oTopNode As BrowserNode

If oDoc.DocumentType = kPartDocumentObject
	oPane = oDoc.BrowserPanes.Item("PmDefault")
Else 'kAssemblyDocumentObject or 
		oPane = oDoc.BrowserPanes.Item("Model")
End If

		
	oTopNode = oPane.TopNode

If oTopNode.BrowserNodeDefinition.Label <> System.IO.Path.GetFileNameWithoutExtension(oDoc.FullFileName) Then
	oDoc.DisplayName = System.IO.Path.GetFileNameWithoutExtension(oDoc.FullFileName)
End If 
		


Catch
debug("RenameBrowsernoteALL ilogic code fail for unknown reason")
End Try
debug("End ilogic: RenameBrowsernoteAll")

End Sub

Public Sub debug(txt As String)
        Trace.WriteLine("NTI : " & txt)
End Sub

 that seens to work a lillte better, but people still it not 100 %  it seens (other usere still running it to files that does not get reset to ""

0 Likes
Message 4 of 4

WCrihfield
Mentor
Mentor

Hi @Darkforce_the_ilogic_guy.  Over the years of interacting with files from many different people from all over through the forums, I have noticed that the Document.DisplayName is not that stable.  Not only because it is a Read/Write property, but because sometimes it seems to include file extension, and sometimes it does not.  That is one of the reasons why I don't like to rely on the iProperties.Value(sDocName, sPropSetName, sPropName) iLogic snippet for accessing the iProperties of referenced documents directly.  Lately, if I have a 'new' document open that has not been saved yet, it will still have a DisplayName, but no file extension yet, because it has not been saved yet, so no file yet.  But after that same document has been saved, its DisplayName will then include the file extension.  It seems to me like we used to have some level of control over what the DisplayName included, but I can't remember how/where.

 

Beyond that, here is a nice custom Function just for getting the 'Model' BrowserPane, which uses BrowserPane.BuiltIn, BrowserPane.TreeBrowser, and BrowserPane.InternalName to get the correct one, no matter which type of document it is, or what language your installation of Inventor is.  You already know that when it is a Part, the InternalName for the Model browser is "PmDefault", but when it is an assembly it is "AmBrowserArrangement", and when it is a drawing it is "DlHierarchy".  Just specifying "Model" works good for English language installations, but not for many other languages.

Function GetModelBrowserPane(oDoc As Inventor.Document) As Inventor.BrowserPane
	For Each oPane As Inventor.BrowserPane In oDoc.BrowserPanes
		If oPane.BuiltIn And oPane.TreeBrowser And _
			(oPane.InternalName = "AmBrowserArrangement" Or _
			oPane.InternalName = "DlHierarchy" Or _
			oPane.InternalName = "PmDefault") Then Return oPane
	Next
	Return Nothing
End Function

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes