若一个装配是焊接件,其AssemblyComponentDefinition是WeldmentComponentDefinition,通过它可以访问到焊接方面的对象和信息,例如焊接或焊缝。焊接是Weld,焊缝是WeldBead。
可以把Weld理解为一种特征。Weld是盖面焊(CosmeticWeld)和焊缝( WeldBead )的基类。它们都提供了WeldInfo以返回焊接的描述信息,是XML形式。 WeldBead还有一些属性告知生成焊缝的面,以及焊缝本身的面。以下是个简单例子,获取某个焊缝信息。
Public Sub test()
'get document and definition
Dim oDoc As AssemblyDocument
Set oDoc = ThisApplication.ActiveDocument
Dim oCompDef As AssemblyComponentDefinition
Set oCompDef = oDoc.ComponentDefinition
'if this is a weld document
If oCompDef.Type = kWeldmentComponentDefinitionObject Then
Dim wcd As WeldmentComponentDefinition
Set wcd = oCompDef
Else
Exit Sub
End If
Dim oCW As CosmeticWeld
For Each oCW In wcd.Welds.CosmeticWelds
Debug.Print "Cosmetic Weld: [" & oC