MACRO LIBRARY

Change BOM quantity in custom properties

Free public access. No account or subscription required.

Files

Change BOM quantity in custom properties

Code

'Written by Keith Rice
'CADSharp LLC
'www.cadsharp.com
    
'Thanks to Filipe Venceslau
    
'To control BOM quantity in custom properties you must a system-defined custom property called _
    "UNIT_OF_MEASURE".
    
'Precondition: part or assy is open
'Postconditions: BOM qty is changed to " - none - "
    
Dim swApp As SldWorks.SldWorks
Dim swModel As ModelDoc2
Dim swCustPropMgr As SldWorks.CustomPropertyManager
    
Sub main()
    Set swApp = Application.SldWorks
    Set swModel = swApp.ActiveDoc
    Set swCustPropMgr = swModel.Extension.CustomPropertyManager(Empty)
    swCustPropMgr.Set "UNIT_OF_MEASURE", " - none - "
End Sub