Used for extended data 1010 1020 1030

Used for extended data 1010 1020 1030

saitoib
Advocate Advocate
579 Views
2 Replies
Message 1 of 3

Used for extended data 1010 1020 1030

saitoib
Advocate
Advocate

Hi all


I would like to save three real numbers, angle1, angle2 and distance, in extended data.
I know that extension data 1010, 1020 and 1030 are areas for 3D coordinates, is there any problem in using them?

 

Thank you .

Saitoib
0 Likes
Accepted solutions (1)
580 Views
2 Replies
Replies (2)
Message 2 of 3

hak_vz
Advisor
Advisor
Accepted solution

@saitoib 

To save real numbers in extended data you have to use key 1040.

For test create new drawing and add some entity, let say polyline.

Now copy line by line of following code into console and hit enter.

Select polyline when asked.

 

(regapp "saitoib")
(setq ent (entget (car (entsel "\nSelect object to add xdata >"))))
(setq ang1 0.5 ang2 0.6 ang3 0.3)
(setq data (list (list -3 (list "saitoib" (cons 1040 ang1)(cons 1040 ang2)(cons 1040 ang3))))
(setq newent (append ent data))
(entmod newent)

 

Save drawing and close.

Reopen and copy following line in console

 

(setq data (assoc -3 (entget (car (entsel)) '("saitoib"))))

 

 

You will receive

 

 (-3 ("saitoib" (1040 . 0.5) (1040 . 0.6) (1040 . 0.3)))

 

Look at entget construction with added app name.

 

Now try with data set as:

 

(setq ang1 0.5 ang2 0.6 ang3 0.3)

(setq data (list (list -3 (list "saitoib" (cons 1000 "ang1")(cons 1040 ang1)(cons 1000 "ang2")(cons 1040 ang2)(cons 1000 "ang3")(cons 1040 ang3)))))

 

To reread data use functions  CAR CADR..... MEMBER and ASSOC.

For scaled distance use 1041.

 

 

 

 

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Message 3 of 3

saitoib
Advocate
Advocate

I can use the 1040 key more than once, can't I?
I understand.

Thank you very much.

Saitoib
0 Likes