rules

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Dim repMgr As RepresentationsManager = ThisApplication.ActiveDocument.ComponentDefinition.RepresentationsManager
'record current LevelOfDetailRepresentation
Dim oCurrentRepName As String = repMgr.ActiveLevelOfDetailRepresentation.Name
Dim valore As Double
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
valore = Math.Round(iProperties.Mass/1000,3) & ( Ton )
iProperties.Value("Custom", oRepName) = valore & " Tons "
Next
'restore
repMgr.LevelOfDetailRepresentations.Item(oCurrentRepName).Activate
"
With this rule found on the net I can create
custom parameters that allow me to calculate the weight of everything that I have not suppressed.
it would be useful to have also the specific gravity (to see if when i have only steel it is correct)
but the density doesn't let me put or recall it
I created another rule
that calculates it but I can not get it to take another parameter name
but specific rule:
dens = iProperties.Mass / iProperties.Volume
iProperties.Value("Custom", "Pes.sp") = Round(dens * 1000 * 1000, 2) & " g/cm^3"
How can I do this?
thank you all you are a great community