Drawing System
Home Products Services VBA for ADT

Drawing System

The ADT drawing environment is maintained and controlled through the AecBaseDatabasePreferences object.  Some simple tasks that could be done with this object are

  • Set the drawing scale
  • Set the annotation text height
  • Set the FacetDeviation setting
  • Save current settings as Default

 The Code

Getting The Drawing Scale

 
Function GetDrawingScale() As Double
    Dim dbPref As AecArchBaseDatabasePreferences
    Set dbPref = AecArchBaseApplication.ActiveDocument.Preferences
    GetDrawingScale = dbPref.DatabaseScale
End Function

Setting the Drawing Scale

Sub SetDrawingScale(scl As Double)
    Dim dbPref As AecArchBaseDatabasePreferences
    Set dbPref = AecArchBaseApplication.ActiveDocument.Preferences
    dbPref.DatabaseScale = scl
End Sub

Getting the Annotation Text Height

 
Function GetAnnoScale() As Double
    Dim dbPref As AecArchBaseDatabasePreferences
    Set dbPref = AecArchBaseApplication.ActiveDocument.Preferences
    GetAnnoScale = dbPref.TextHeight
End Function

Setting the Annotation Text Height


      
Sub SetAnnoScale(scl As Double)
    Dim dbPref As AecArchBaseDatabasePreferences
    Set dbPref = AecArchBaseApplication.ActiveDocument.Preferences   
    dbPref.TextHeight = scl
End Sub

Getting the Facet Deviation Setting

 
Sub SetFacetDev(dev As Double)
    Dim dbPref As AecArchBaseDatabasePreferences
    Set dbPref = AecArchBaseApplication.ActiveDocument.Preferences   
    dbPref.FacetDeviation = dev
End Sub

 

Setting the Facet Deviation Setting 


      
Sub SetFacetDev(dev As Double)
    Dim dbPref As AecArchBaseDatabasePreferences
    Set dbPref = AecArchBaseApplication.ActiveDocument.Preferences   
    dbPref.FacetDeviation = dev
End Sub

Saving the Current Settings as Default

 
Sub SaveAsDef()
    Dim dbPref As AecArchBaseDatabasePreferences
    Set dbPref = AecArchBaseApplication.ActiveDocument.Preferences   
    dbPref.SaveAsDefault
End Sub