Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I use getcfg in VBA ? PLEASE HELP

Status
Not open for further replies.

sdtopo

Structural
Jan 17, 2010
1
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
 
Replies continue below

Recommended for you

What string are you trying to extract?

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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor