How can I use getcfg in VBA ? PLEASE HELP
How can I use getcfg in VBA ? PLEASE HELP
(OP)
I am trying to pass information from vba to autocad using the acad.cfg file.
I use the following syntax:
Dim zzGetVarzz as String
ThisDrawing.SendCommand "(setvar ""USERS1"" (getcfg ""AppData/SDTOPO/StringForTitle""))" & vbCr
zzGetVarzz = AutoCAD.Application.ActiveDocument.GetVariable("USERS1")
This works OK only if i use it one or two times within the Sub.
I need to call this syntax over 80 times within the same Sub and when i run it it seems command line gets confused (synchronising issues) with so many commands and does not work rigth.
If anyone could give an example of how to use "Autocad.Application.Prefernces.property property"
which is the comparision of getcfg in vba (whithout using sendcommand).
Thank you in advance.
Please help
I use the following syntax:
Dim zzGetVarzz as String
ThisDrawing.SendCommand "(setvar ""USERS1"" (getcfg ""AppData/SDTOPO/StringForTitle""))" & vbCr
zzGetVarzz = AutoCAD.Application.ActiveDocument.GetVariable("USERS1")
This works OK only if i use it one or two times within the Sub.
I need to call this syntax over 80 times within the same Sub and when i run it it seems command line gets confused (synchronising issues) with so many commands and does not work rigth.
If anyone could give an example of how to use "Autocad.Application.Prefernces.property property"
which is the comparision of getcfg in vba (whithout using sendcommand).
Thank you in advance.
Please help





RE: How can I use getcfg in VBA ? PLEASE HELP
You're right to stay away from sendcommand, it's probably not going to work for your application.
You can play with the preferences as so:
ThisDrawing.Application.Preferences.Application.Preferences.System.BeepOnError = False
Intellisense will help you with figuring out what is available. Also hitting F2 in the IDE will bring up an object browser which let you see what's available. The autoCAD help file is also quite useful.
Tim Grote - The Irrigation Engineers.
www.irrigationengineers.com