Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Adding Xdata From Slected Mtext or Text

4 REPLIES 4
Reply
Message 1 of 5
karunakaran1991
289 Views, 4 Replies

Adding Xdata From Slected Mtext or Text

Hi,

 

I am new to Xdata Data handling via Lisp.

 

I am in need of lisp routine and the work is to selected Mtext or text corresponding content is to be added as Xdata to the selected Entity.

 

 I created a lisp routine also but its not working could anybody help to fix this issue and the code is 

 

(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 )))))

)

 

4 REPLIES 4
Message 2 of 5

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.

 

Message 3 of 5

Hi,

 

Try with this: (setq thedata (list -3 (list "Test_Xdata" (cons 1000 Xdata1)(cons 1000 Xdata2))))

 

 

Gaston Nunez

Message 4 of 5
hmsilva
in reply to: karunakaran1991


@karunakaran1991 wrote:

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.

 


Hi karunakaran1991,

please dont start multiple threads on the same subject... it becomes harder to to help...


Have you ever seen the reply to your other Adding Xdata From Slected Mtext or Text

 

Hope that helps

Henrique

EESignature

Message 5 of 5

I tried the above code but the same error occurs and thanks for your precious time to look into it.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost