how to read name of current LOD

how to read name of current LOD

Anonymous
Not applicable
376 Views
2 Replies
Message 1 of 3

how to read name of current LOD

Anonymous
Not applicable

Hi,

 

I want to read the name of the LOD that is active and return it via msgbox but it's not working for me?

 

 

Dim oDoc As AssemblyDocument
oDoc = ThisApplication.ActiveDocument

Dim test As String
test = LevelOfDetailRepresentation.Name()

MessageBox.Show("Message" & test, "Title")

 

whats not correct?

0 Likes
377 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable

I found this on the forum:

 

currentLOD = ThisDoc.Document.ComponentDefinition.RepresentationsManager.ActiveLevelofDetailRepresentation.Name

 

 

But i get "Error on Line 1 : End of statement expected."

 

 

 

 

0 Likes
Message 3 of 3

MegaJerk
Collaborator
Collaborator

The simplest way would probably be :

 

MessageBox.Show(ThisDoc.Document.LevelOfDetailName)

 

 

You could also do something like this if you wanted to, but it wouldn’t be that great for sub-assemblies :

 

If ThisApplication.ActiveDocument.DocumentType <> kAssemblyDocumentObject Then
       Return
End If
 
Dim assemblyDoc As AssemblyDocument
assemblyDoc = ThisApplication.ActiveDocument
 
MessageBox.Show(assemblyDoc.LevelOfDetailName)

 


If you wanted to be dangerous you could just do :

 

 
MessageBox.Show(ThisApplication.ActiveDocument.LevelOfDetailName)
 

 



If my solution worked or helped you out, please don't forget to hit the kudos button 🙂
iLogicCode Injector: goo.gl/uTT1IB

GitHub
0 Likes