Hello together,
I am looking for a possibility to control the PositionalRepresentations and LevelOfDetail. If I choose number one (01_ text varies ) of the PositionalRepresentations the LevelOfDetail should switch to 01_XXXX.
I found a peace of could that switches but the names must be equal.
Is it possible to modify the code to do that?
Thank you very much
Georg
Hi Georg,
You could use the "RepresentationEvents.OnActivatePositionalRepresentation" to get notified when a positional rep is activated, based on that you could change the LOD from API:
LevelOfDetailRepresentation.Activate
Sub LoD() Dim doc As AssemblyDocument Set doc = ThisApplication.ActiveDocument Dim mng As RepresentationsManager Set mng = doc.ComponentDefinition.RepresentationsManager Dim LoDs As LevelOfDetailRepresentations Set LoDs = mng.LevelOfDetailRepresentations LoDs.item("MyLoD").activate doc.Rebuild ' Create a new level of detail. Dim oLODRep As LevelOfDetailRepresentation Set oLODRep = LoDs.Add("My LOD") ' Suppress an occurrence. doc.ComponentDefinition.Occurrences.item(1).Suppress ' Save the document, which is really saving the LOD. ThisApplication.ActiveDocument.Save ' Activate the master LOD. mng.LevelOfDetailRepresentations.item("Master").activate End Sub
Philippe.