This is from a forum post in which one customer wanted to get mass of each LOD and display them on the drawing of top assembly.
The advocate Rossano Praderi shared a solution which is nice to me. He provided the dataset only. I think it will be helpful for more customers with the workflow and codes out of the dataset. So I wrote this blog. Thanks Rossano Praderi!
1. In the attached dataset, there is a top assembly with several components. Three LOD (First, Second, Third) are created.
2. The corresponding drawing of the top assembly is also created.
3. An iLogic rule is attached with this assembly. It activates each LOD one by one, and updates the value of corresponding custom property with the Mass value. If such custom property does not exist, it will be created automatically.
'get RepresentationsManager Dim repMgr As RepresentationsManager = ThisApplication.ActiveDocument.ComponentDefinition.RepresentationsManager
'record current LevelOfDetailRepresentation Dim oCurrentRepName As String = repMgr.ActiveLevelOfDetailRepresentation.Name
Dim oRep As LevelOfDetailRepresentation Dim oRepName Dim oMass
For Each oRep In repMgr.LevelOfDetailRepresentations oRepName = oRep.Name 'activate this LOD repMgr.LevelOfDetailRepresentations.Item(oRepName).Activate 'get mass oMass = iProperties.Mass 'update value of custom property iProperties.Value("Custom", oRepName) = iProperties.Mass Next
'restore repMgr.LevelOfDetailRepresentations.Item(oCurrentRepName).Activate |
4. In the drawing document, define some Property Text (from model) in the sheet. e.g. if we need the information of First/Second/Thrid LOD. The values will be displayed in the sheet.