×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

How can I use getcfg in VBA ? PLEASE HELP

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

RE: How can I use getcfg in VBA ? PLEASE HELP

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.
www.irrigationengineers.com

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources