karunakaran1991 Posted October 25, 2014 Posted October 25, 2014 Hi, I am creating lisp routine and the work is to selected Mtext or text and the corresponding content is to be added as Xdata to the selected entity. (defun C:addxdata() (setq a(entget(car(entsel"\nSelect Text: ")))) (setq Xdata1 (cdr (assoc 1 a))) (princ Xdata1) (setq b(entget(car(entsel"\nSelect Text: ")))) (setq Xdata2 (cdr (assoc 1 b))) (princ Xdata2) (regapp "Test_Xdata" ) (setq oldlist (entget (car (entsel)))) (setq thedata '((-3 ("Test_Xdata" (1000 . Xdata1) (1000 . Xdata2 ))))) ) Then I used list Xdata option available under Express tool Tab (Auto Cad 2014). I didn't find any Xdata Attached with it. After Adding the Xdata, I wanna export to Excel. For the Excel Conversion, Lisp is working good. I guess the Problem is in the following line, (setq thedata '((-3 ("Test_Xdata" (1000 . Xdata1) (1000 . Xdata2 ))))) Eventhough the value stored in variable it is not working properly. With Regards, Karunakaran. Quote
Lee Mac Posted October 25, 2014 Posted October 25, 2014 By quoting the expressions, the variables will not be evaluated to yield the values they hold - I would suggest reading my tutorial on the Apostrophe and the Quote Function to understand more about this concept. Lee Quote
SLW210 Posted October 27, 2014 Posted October 27, 2014 Please read the Code Posting Guidelines and edit your post to include the Code in Code Tags. Quote
karunakaran1991 Posted October 29, 2014 Author Posted October 29, 2014 Thank you Lee I got it where I missed and the referred info are usefull. 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.