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
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