Message 1 of 2
VBA to ARX

Not applicable
08-09-2007
03:46 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a routine in VBA that needs its equivalent in ARX. Any idea how it can be done? Basically this routine reads system variables, in this case dimtxt, from another drawing without opening it and returns the value to the calling application.
Public Function getSystemvariable() as Double
Set objDbx = GetInterfaceObject("ObjectDBX.AxDbDocument.17")
Dim inDir As String
Dim filenom As String
Dim WholeFile As String
Dim dimTxtVar as Double
inDir = "c:\program files\autocad\test"
filenom = Dir$(inDir & "\*.dwg")
WholeFile = inDir & "\" & filenom
objDbx.Open WholeFile
dimTxtVar = objDbx.GetVariable ("dimtxt")
Set objDbx = Nothing
getSystemvariable = dimTxtVar
End Sub
Public Function getSystemvariable() as Double
Set objDbx = GetInterfaceObject("ObjectDBX.AxDbDocument.17")
Dim inDir As String
Dim filenom As String
Dim WholeFile As String
Dim dimTxtVar as Double
inDir = "c:\program files\autocad\test"
filenom = Dir$(inDir & "\*.dwg")
WholeFile = inDir & "\" & filenom
objDbx.Open WholeFile
dimTxtVar = objDbx.GetVariable ("dimtxt")
Set objDbx = Nothing
getSystemvariable = dimTxtVar
End Sub