By Barbara Han
When creating a new drawing in AcadM 2013 and running the command "_ampartrefedit" with option "_a" (assembly properties). A dialog shows up and the user can add/define properties. Some of our partner need to access to those property data using API.
The assembly property is associated with the model space block table record. So you can first get the model space ID and use API AcmBOMManager::getPartData() to get the assembly property data. This API is provided by SymBBAuto type library. For AutoCAD Mechanical 2013, you need to add reference to SymBBAuto 4.0 type library.
The following are two VBA samples that you can refer to:
Sub setgetAssemblyAttributes() ' Set reference to symbol Manager ' Set reference to BOM Manager ' Get the assembly attributes from current database modelspace If VarType(vdata) = vbEmpty Then 'Create the data to be assigned Next End If |
Sub modAssemblyAttributes() ' Set reference to symbol Manager ' Set reference to BOM Manager ' Get the assembly attributes from current database modelspace End Sub |