oarrow Posted January 18, 2013 Posted January 18, 2013 (edited) I'm adding XData to user drawn lines utilizing AutoLISP. The following code works fine: (setq CLoop "CIRC1") (if (not (tblsearch "APPID" CLoop)) (regapp CLoop) );end if (setq xdList '((-3 ("CIRC1" (1000 . "Circuit 1") (1000 . "Reactor Effluent"))))) I'm having trouble substituting variables for "CIRC1", "Circuit 1" and "Reactor Effluent"... I've tried: (setq LNo "Circuit 1" desc "Reactor Effluent" ) (setq xdList '((-3 ("CIRC1" (cons 1000 LNo) (cons 1000 desc))))) I would also like to replace "CIRC1" with a variable as well. This gives me a bad DXF Group Code error. I've tried various combinations of List and Cons and Quote but can't seem to get it! Please help - thanks! Edited January 18, 2013 by SLW210 add code tags Quote
MSasu Posted January 18, 2013 Posted January 18, 2013 By usign quote you are preventing the list to be evaluated; please try this instead: (setq xdList ([color=red]list[/color] ([color=red]list[/color] -3 ([color=red]list[/color] "CIRC1" (cons 1000 LNo) (cons 1000 desc))))) Quote
SLW210 Posted January 18, 2013 Posted January 18, 2013 Please read the CODE POSTING GUIDELINES and add Code Tags to your code. Quote
oarrow Posted January 18, 2013 Author Posted January 18, 2013 I was lost in "lists"... That solved my problem - thank you! Quote
oarrow Posted January 18, 2013 Author Posted January 18, 2013 I apologize and will follow the code posting guidelines in the future - thank you. 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.