HorizontalScale setting

Discussion in 'AutoCAD' started by mgrigoriev, Jul 14, 2004.

  1. mgrigoriev

    mgrigoriev Guest

    Hi, I am using Land Desktop 3. In one of the posts I found a code which returns the HorizontalScale setting for the current drawing. It seems to work only after you go to Projects-->Drawing Setup. If you run the code right after you open the drawing, it will give you an error: Automation error.Unspecified error. Is there a way to be able to get the scale without going to Projects-->Drawing Setup first?

    Sub Example_DatabaseScale()
    ' This example returns the HorizontalScale setting for the current drawing.
    Dim dbPref As AeccDatabasePreferences
    Set dbPref = AeccApplication.ActiveDocument.preferences
    MsgBox "The current value for DatabaseScale is: " & dbPref.DatabaseScale, _
    vbInformation, "DatabaseScale Example"
    End Sub
     
    mgrigoriev, Jul 14, 2004
    #1
  2. mgrigoriev

    lorier Guest

    Hi, you might want to search "initialize" under the Land Desktop news groups or maybe repost there.

    This was posted a while back...

    Private Sub civil()
    On Error Resume Next
    Set EgProfTest = align.EGProfiles

    If Err.Description = "Civil Desktop has not been loaded." Then
    ' clear the error message for the second test
    Error = 0
    Dim Acad As AcadApplication
    Set Acad = GetObject(, "AutoCAD.Application")
    Dim sCivilProg As String

    sCivilProg = Acad.Application.Path & "\land\aeccsite.arx"
    ' first see if Civil Design is installed
    If UCase(Dir(sCivilProg)) = "AECCSITE.ARX" Then
    ' send the civil design init call
    ThisDrawing.SendCommand ("(cd_mnl) ")
    DoEvents
    ' text to see if init was successful
    Set EgProfTest = align.EGProfiles
    If Err.Description = "Civil Desktop has not been loaded." Then
    MsgBox "Error trying to load Civil Design.", vbOKOnly
    GoTo LoadFailed
    End If
    Else
    MsgBox "Civil Design must be installed to import Profiles.", vbOKOnly
    Error = 0
    GoTo LoadFailed
    End If
    ElseIf Err.Number <> 0 Then
    MsgBox "Error trying to load Civil Design.", vbOKOnly
    'MsgBox GetResStr(1454), vbOKOnly, LxWarnMsgCap
    GoTo LoadFailed
    End If
    ' if it gets to here then the load was successful, or it wasn'tnecessary
    LoadCivilDesign = True
    ' jump to here if the load failed
    LoadFailed:
    LoadCivilDesign = False
    End Sub
     
    lorier, Jul 14, 2004
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.