why are it saying that it is not Overriden ? when browsernote

why are it saying that it is not Overriden ? when browsernote

Darkforce_the_ilogic_guy
Advisor Advisor
325 Views
3 Replies
Message 1 of 4

why are it saying that it is not Overriden ? when browsernote

Darkforce_the_ilogic_guy
Advisor
Advisor

why does this not work. I have a part that browser notes is not the same as filename on a part ..

 

if i remove the if statment . if will fix it ... but I do not want it to run is there is no change..

 

when I delete et manuely ..It say i have rename the Root component. is there a better way to only delete the Root component name  /display name  text when it have been  change ? I dont want it to run on all 

 

 

bt_1-1664973008157.png

 

 

bt_0-1664972947688.png

 

 

 

 

doc = ThisDoc.Document

If doc.DisplayNameOverridden = True  Then

	doc.DisplayName=""
End If

 

 

0 Likes
Accepted solutions (2)
326 Views
3 Replies
Replies (3)
Message 2 of 4

WCrihfield
Mentor
Mentor

Hi @Darkforce_the_ilogic_guy.  The DisplayName is obviously a Read/Write property, but it is also not entirely stable in my opinion, which is why I generally choose not to rely on its use when writing iLogic code that I need to be able to rely on.  It can show different results for different people.  For instance, sometimes it will include the file's extension, and other times it will not.  It seems to me like some time in the past, I saw a setting somewhere that controls what information it will include, but I can't find any setting like that anymore.  I can reproduce the behavior you are seeing, because it does not believe that the document's DisplayName has been overridden, so it does not run your code within that If statement, which would have fixed the name.  The main question I have now is, how/where did it get that current name that it is showing, if it is not the name of the file, and why did setting that name not toggle the document's DisplayNameOverridden to True?  If you need to make sure your DisplayName always matches the file's name, you could simply bypass using that DisplayNameOverridden property, and check whether it matches the file's name or not, and if not, set it to an empty string or the file's name directly.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 4

WCrihfield
Mentor
Mentor
Accepted solution

Here is another little iLogic rule you can use for exploring this issue.  It accesses the BrowserPane, and its TopNode directly, then shows you its FullPath & Label.  After some messing around with your file, I now have it to a place where it is showing the original odd name at the top of the model browser, but another rule that simply shows the DisplayName in a MsgBox, shows the correct file name, with extension, and that property does not believe that it has been overridden at this point either.

Dim oDoc As PartDocument = ThisDoc.Document
'get Model pane using its InternalName
Dim oPane As BrowserPane = oDoc.BrowserPanes.Item("PmDefault")
Dim oTopNode As BrowserNode = oPane.TopNode
MsgBox("oTopNode.FullPath = " & oTopNode.FullPath, , "")
MsgBox("oTopNode.BrowserNodeDefinition.Label = " & oTopNode.BrowserNodeDefinition.Label,,"")

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 4 of 4

Darkforce_the_ilogic_guy
Advisor
Advisor
Accepted solution

I user what I leard form your code to create this code that seens to work

 

Try

doc = ThisDoc.Document
Dim oPane As BrowserPane = doc.BrowserPanes.Item("PmDefault")
Dim oTopNode As BrowserNode = oPane.TopNode


If doc.DisplayNameOverridden = True  Then
doc.DisplayName.CompareTo.GetTypeCode
	doc.DisplayName = ""
	
Else
	
	If oTopNode.BrowserNodeDefinition.Label <> doc.DisplayName Then
	doc.DisplayName = ""	
	End If 
	
End If 

Catch
Logger.Info("RenameBrowsernoteALL ilogic code fail for unknow reason", filename)
	
End Try