How to detrmine if a custom level of detail has been saved?

How to detrmine if a custom level of detail has been saved?

Anonymous
Not applicable
521 Views
4 Replies
Message 1 of 5

How to detrmine if a custom level of detail has been saved?

Anonymous
Not applicable

I need to vallidate if a custom level of detail has been saved, any ideas?

0 Likes
Accepted solutions (1)
522 Views
4 Replies
Replies (4)
Message 2 of 5

perrysc
Enthusiast
Enthusiast

Saved where? Your workspace? Another employee's workspace? Other?

0 Likes
Message 3 of 5

Anonymous
Not applicable

The assembly document is saved to a location designated by the user, so this could either local or networked. Whilst it is straightforward to find out if the assembly document has been saved, my question relates to whether it is possible to identify if a assembly document has been saved with a specific level of detail. At this stage I have the document in memory.

 

The application is used to copy an assembly to a new location, renaming the assembly and all its component parts then rebuilding the assembly using the new components. Part of the vallidation process is to ensure that the current level of detail has been saved before committing the transfer.

0 Likes
Message 4 of 5

perrysc
Enthusiast
Enthusiast
Accepted solution

I'd imagine it would be something like this.

 

Dim oAsmDoc As AssemblyDocument = ThisApplication.ActiveDocument 'or other reference to it
Dim oAsmDef As AssemblyComponentDefinition = oAsmDoc.ComponentDefinition
Dim oLODwanted As String 'The name of your LOD you want to be saved as

Dim oHasBeenSaved As Boolean = False
For Each oLOD As LevelOfDetailRepresentation In oAsmDef.RepresentationsManager.LevelOfDetailRepresentations
If oLOD.LevelOfDetail = 56072 AndAlso oLOD.Name = oLODWanted Then 'is kCustomLevelOfDetail and namecheck
oHasBeenSaved = True
MsgBox("This assembly has been saved with " & oLODwanted)
Exit For
End If
Next
If Not oHasBeenSaved Then
MsgBox("This assembly has not been saved with " & oLODwanted)
Exit Sub
End If
Message 5 of 5

Anonymous
Not applicable

Explanation: The level of detail enumerator resides as kSandboxLevelOfDetail until saved, which can be monitored as Perry has indicated. Thanks Perry, good answer. Peter

0 Likes