sdtopo Posted January 16, 2010 Posted January 16, 2010 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. Quote
SEANT Posted January 17, 2010 Posted January 17, 2010 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. Quote
sdtopo Posted January 17, 2010 Author Posted January 17, 2010 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. Quote
SEANT Posted January 18, 2010 Posted January 18, 2010 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. Quote
sdtopo Posted January 18, 2010 Author Posted January 18, 2010 Thank you. I will try to find simple examples for transfering data between VBA and Lisp or Vlisp, using dictionarys. Thanks a lot. Quote
Recommended Posts
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.