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

Trying to update xdata 1013 - Xdata code syntax incorrect

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
mk_m68
384 Views, 2 Replies

Trying to update xdata 1013 - Xdata code syntax incorrect

I'm having trouble getting this code to update the xdata of an entity.  

 

This is what I'd like the xdata to look like when I query the xdata after the update.

 

* Registered Application Name: MYAPP
* Code 1013, 3D World space direction: (0.0 0.0 1.0)
* Code 1013, 3D World space direction: (-1.0 0.0 0.0)
* Code 1013, 3D World space direction: (0.0 -1.0 0.0)

 

 

What isn't correct here?  

Also, I'm sure there is a way to condense this code .......  

 

(If you haven't figured it out yet I'm very new at programming and Autolisp)

 

(defun c:xd1013 ()

(regapp "MYAPP")

(setq enlst (entget (entlast)))

(setq MYAPP '((-3 ("MYAPP" (list 1013 0.0 0.0 1.0) ))))
(setq newent (append enlst MYAPP))
(entmod newent)

(setq MYAPP '((-3 ("MYAPP" (list 1013 -1.0 0.0 0.0) ))))
(setq newent (append enlst MYAPP)) 
(entmod newent)

(setq MYAPP '((-3 ("MYAPP" (list 1013 0.0 -1.0 0.0) ))))
(setq newent (append enlst MYAPP)) 
(entmod newent)

 

)

 

 

 

Many Thanks!

 

2 REPLIES 2
Message 2 of 3
gilsonrss
in reply to: mk_m68

Hi,

 

I believe the correct thing:

 

(setq MYAPP '((-3 ("MYAPP" (1013 0.0 0.0 1.0) ))))

 

without the "list" in the last parenthesis

 

 

 

Message 3 of 3
mk_m68
in reply to: gilsonrss

Many thanks.

 

Michael

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

Post to forums  

Autodesk Design & Make Report

”Boost