2006-10-23

How to set the standard

In AutoCAD Mechanical, standards are the... well standards by which other things are measured. We base everything off the ISO standard so that we are all on the same "page" so to speak. Most of our customers live by this standard, so it becomes even more important to adhere to their "gold standard" (hint hint ... final payment). Anyway, we generally use a template to start drawings with our standard in place. We have had times where a rogue user or an outside drawing made its way into the mix, so I came up with a little macro to "set the standard". After setting a reference to the SymBBAuto library, use the following to get the standard you always wanted.


Private Sub SetMeStdToIso()
'------------------------------------------------------------------------------
'SetMeStdToIso:
'------------------------------------------------------------------------------
On Error Resume Next
Dim mcadSymBb As McadSymbolBBMgr
Dim mcadStdMgr As McadStandardMgr
Dim mcadStd As McadStandard
'--------------------------------------
Set mcadSymBb = ThisDrawing.Application.GetInterfaceObject("SymBBAuto.McadSymbolBBMgr")
Set mcadStdMgr = mcadSymBb.StandardMgr

mcadStdMgr.CurrentStandardName = "ISO"
If mcadStdMgr.StandardCount > 1 Then
For Each mcadStd In mcadStdMgr.Standards
If mcadStd.name <> "ISO" Then 'Or mcadStd.Name <> "DIN" Then
mcadStd.Delete
End If
Next mcadStd
End If
End Sub


No comments: