Combine 3 Semi
Combine 3 Semi
ActiveDocument
oAcompdef = oAdoc.ComponentDefinition
'conversion factor cm to in
oCF = 0.393701*25.4
oX = (oOcc.definition.RangeBox.MaxPoint.X _
- oOcc.definition.RangeBox.MinPoint.X)*oCF
oY = (oOcc.definition.RangeBox.MaxPoint.Y _
- oOcc.definition.RangeBox.MinPoint.Y)*oCF
oZ = (oOcc.definition.RangeBox.MaxPoint.Z _
- oOcc.definition.RangeBox.MinPoint.Z)*oCF
Set_Width:
iProperties.Value(oOcc.Name, "Custom", "Width") _
= Round(oMiddle,3)
'set length
iProperties.Value(oOcc.Name, "Custom", "Length") _
= Round(MaxOfMany(oX, oY, oZ),3)
'set Thickness
iProperties.Value(oOcc.Name, "Custom", "Thickness") _
= Round(MinOfMany(oX, oY, oZ),3)
Next oOcc
If oADoc.DocumentType = DocumentTypeEnum.kAssemblyDocumentObject
oDoc = oADoc
Else If oADoc.DocumentType = DocumentTypeEnum.kDrawingDocumentObject
Try
oDoc =
oADoc.ActiveSheet.DrawingViews.Item(1).ReferencedDocumentDescriptor.ReferencedDocum
ent
Catch
MsgBox("LOD in use in drawing; Macro failed!")
End Try
Else
MsgBox("Invalid Document!")
End If
oBOM.ImportBOMCustomization("D:\bom.xml")
oBOM.StructuredViewEnabled = True
oBOM.StructuredViewFirstLevelOnly = False
oBOM.PartsOnlyViewEnabled = True