Olhado_ Posted January 7, 2009 Posted January 7, 2009 I really hope someone can help me here because I am at my wits end here. I have a program that I am working on, which I tried to do complete in just VBA, which was a failed attempt; but I can do it in LISP, so I am using the VBA to LISP techniques. The only problem it looks like you can only pass pre-defined AutoCAD variables between VBA and LISP (i.e USERS1, USERS2, USERS3, USERS4, USERS5). Is this correct? Anyways, to get to my question I need to pass many file names (as strings) to LISP, a lot more than the 5 user fields allow and because of the restrictions on variable names erasing after the module closes I have to get them all out at one shot. I thought this code below would work; but I forgot the "Getvar" LISP command requires quotes which confuses the VBA SendCommand. [color=black] ThisDrawing.SetVariable "USERS1", ProcessList.List(0)[/color] [color=black] ThisDrawing.SendCommand "(setq UserList (getvar "USERS1"))"[/color] [color=black] For i = ProcessList.ListCount - 2 To step - 1[/color] [color=black] ThisDrawing.SetVariable "USERS1", ProcessList.List(i)[/color] [color=black] ThisDrawing.SendCommand "(setq UserList (cons (getvar "USERS1") UserList))"[/color] [color=black] Next i[/color] Anyways, this is probably not the best way to do it; but like I said I am at my wits end here. Does anyone have any way to make this work? ProcessList = List Box I hope I have provided enough information. Thanks in advance. Quote
CALCAD Posted January 7, 2009 Posted January 7, 2009 Olhado, I don't have a complete answer for you, but for extra user variables there are at least two ways. You can set environment variables in Windows. I have not done this myself, but I have heard that it can be done. I don't know how much space is available for user variables in the environment. Maybe someone on the forum can give specifics. You can also open a text file in Autolisp, write and read anything you want, then delete or keep the file as you wish. I have done that many times and it works well. Hope this helps. Quote
BIGAL Posted January 11, 2009 Posted January 11, 2009 Oh by the way remember to close the file else you will get a read error. Quote
ASMI Posted January 11, 2009 Posted January 11, 2009 Dictionaries is the best way of AutoLISP VBA interchange. Quote
todorb2000 Posted January 12, 2009 Posted January 12, 2009 How to put data from autocad' objects to excel. for example values of text into excel table! 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.