Message 1 of 10
SetVariable

Not applicable
04-16-2002
01:53 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have nothing better to do than play stupid games with AutoCad VBA!!!
Please, would someone be so kind as to explain why I can't set FILEDIA via
the setvariable method in VBA?
I click on the file open button with filedia set to 0, I get prompted on the
command-line. When I run this routine with the setvariable line
uncommented, I still get prompted on the command-line. When I use the
sendcommand line, it works.
Ideas?
Sub Set_ODM_Defaults()
' set default values for common variables
'
' all routines (lisp, vba, etc) should
' save current settings before changing values
' then reset values after use - but they don't
' this routine should reset most common settings
ThisDrawing.SetVariable "acadlspasdoc", 1
ThisDrawing.SetVariable "attdia", 1
ThisDrawing.SetVariable "blipmode", 0
ThisDrawing.SetVariable "cmddia", 1
ThisDrawing.SetVariable "dimunit", 2
ThisDrawing.SetVariable "dimtxt", 0.18
ThisDrawing.SetVariable "textsize", 0.18
ThisDrawing.SetVariable "dimasz", 0.18
ThisDrawing.SetVariable "dimadec", 3
ThisDrawing.SetVariable "dimupt", 1
' ThisDrawing.SetVariable "filedia", 1
ThisDrawing.SendCommand "filedia 1 "
ThisDrawing.SetVariable "mirrtext", 0
ThisDrawing.SetVariable "osmode", 1025
ThisDrawing.SetVariable "sdi", 0
ThisDrawing.SetVariable "userr1", 1
SetTextStyle
End Sub
Please, would someone be so kind as to explain why I can't set FILEDIA via
the setvariable method in VBA?
I click on the file open button with filedia set to 0, I get prompted on the
command-line. When I run this routine with the setvariable line
uncommented, I still get prompted on the command-line. When I use the
sendcommand line, it works.
Ideas?
Sub Set_ODM_Defaults()
' set default values for common variables
'
' all routines (lisp, vba, etc) should
' save current settings before changing values
' then reset values after use - but they don't
' this routine should reset most common settings
ThisDrawing.SetVariable "acadlspasdoc", 1
ThisDrawing.SetVariable "attdia", 1
ThisDrawing.SetVariable "blipmode", 0
ThisDrawing.SetVariable "cmddia", 1
ThisDrawing.SetVariable "dimunit", 2
ThisDrawing.SetVariable "dimtxt", 0.18
ThisDrawing.SetVariable "textsize", 0.18
ThisDrawing.SetVariable "dimasz", 0.18
ThisDrawing.SetVariable "dimadec", 3
ThisDrawing.SetVariable "dimupt", 1
' ThisDrawing.SetVariable "filedia", 1
ThisDrawing.SendCommand "filedia 1 "
ThisDrawing.SetVariable "mirrtext", 0
ThisDrawing.SetVariable "osmode", 1025
ThisDrawing.SetVariable "sdi", 0
ThisDrawing.SetVariable "userr1", 1
SetTextStyle
End Sub