Jump to content

Recommended Posts

Posted

Hallo

I am an experienced user of AutoLisp and i know the basics of VBA.

Please, if anyone could show me en example of how to use the syntax

"AutoCAD.Application.Preferences.property property" for using the getcfg command in vba.

 

I use:

ThisDrawing.SendCommand "(setvar ""USERS1"" (getcfg ""AppData/SDTOPO/ZLAYRENChooseEpex""))" & vbCr

 

but it does not work everytime because i use over 50 times in a row for several variables.

 

To ensure that it will allways work ok i need to use a command (similar to getcfg) within vba.

 

Thank you in advance.

Posted

Thisdrawing.SendCommand does have a synchronization issue that essentially makes it useless. Unfortunately there doesn’t appear to be any comparable method in the ActiveX object model for the setcfg/getcfg.

 

Even if that is the case, though, the acad2000.cfg file looks easy enough to parse and manipulate with the assistance of FileSystemObject. That route would probably be faster than a “Thisdrawing.SendCommand” method even if there wasn't a synchronization issue.

Posted

Thank you.

I am having diffculty using SystemFileObect (meaning creating and reading my own files) because i have over 150 lisp routines that work with setcf and getcfg.

Is there any other way (without creating my own textfiles) to store data within VBA.

Or is there another way to exchange large ammount of data between Lisp and VBA (for example maybe setenv and getenv ?).

 

Thank you for our time.

Posted

Perhaps using the AcadDictionary and AcadXRecord with VBA may offer similar functionality. Both require a bit of experimentation, but, once understood, they are a powerful asset.

Posted

Thank you.

I will try to find simple examples for transfering data between VBA and Lisp or Vlisp, using dictionarys.

 

Thanks a lot.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...