AutoCAD Map 3D Developer
Welcome to Autodesk’s AutoCAD Map 3D Developer Forums. Share your knowledge, ask questions, and explore popular AutoCAD Map 3D Developer topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Read Data Dictionary Entries

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
Anonymous
1030 Views, 7 Replies

Read Data Dictionary Entries

Anonymous
Not applicable

I'm developing an Autolisp program to piggy back off of an ArcGIS plugin that was created by my company. Previously, we were importing *.SHP files using the mapimport command, so I was able to use the ADE_* commands to access this object data, but now the data is stored in a data dictionary associated with the ACAD object and I'm not sure how to access these values. The attached image shows the tag and value that I'm attempting to access, but this dialog is built into to the plugin. I've done multiple searches on this topic, with no avail, as I'm not very familiar with data dictionary's. Any help would be much appreciated.

0 Likes

Read Data Dictionary Entries

I'm developing an Autolisp program to piggy back off of an ArcGIS plugin that was created by my company. Previously, we were importing *.SHP files using the mapimport command, so I was able to use the ADE_* commands to access this object data, but now the data is stored in a data dictionary associated with the ACAD object and I'm not sure how to access these values. The attached image shows the tag and value that I'm attempting to access, but this dialog is built into to the plugin. I've done multiple searches on this topic, with no avail, as I'm not very familiar with data dictionary's. Any help would be much appreciated.

7 REPLIES 7
Message 2 of 8
Peter2_1
in reply to: Anonymous

Peter2_1
Collaborator
Collaborator

Do you know the chapter inside the Autolisp-documentation:

 

Dictionary Functions Reference (AutoLISP/ActiveX)

http://help.autodesk.com/view/ACD/2018/DEU/?guid=GUID-F5F376FF-9BC2-476A-9EA9-1455D28DE264

 

 

AutoCAD Map 3D 2023 German / Oracle
0 Likes

Do you know the chapter inside the Autolisp-documentation:

 

Dictionary Functions Reference (AutoLISP/ActiveX)

http://help.autodesk.com/view/ACD/2018/DEU/?guid=GUID-F5F376FF-9BC2-476A-9EA9-1455D28DE264

 

 

AutoCAD Map 3D 2023 German / Oracle
Message 3 of 8
Anonymous
in reply to: Peter2_1

Anonymous
Not applicable

Peter2_1,

 

Thank you for the prompt response! I was not aware of these functions, but sadly have not come across a decent example to pick through for my purposes. Maybe you can shed some light on what I may be doing wrong. Though my code may be unconventional, The following is my code so far for this portion

 

 

 

 

(vl-load-com)

(defun c:t ()
(get_intended_objects)
(setq x 0 tlis '())
(repeat (sslength ss)
(get_dictionary_data (ssname ss x))
(setq tlis (append tlis (list nlis)))
(setq x (+ x 1))
)
(princ)
)

(defun get_intended_objects ()
(setq ss (ssget (list (cons -4 "<or")
(cons 0 "point")
(cons -4 "or>")
)))
(princ)
)

(defun get_dictionary_data (ent)
(setq dict (cdr (assoc 3 (entget (cdr (assoc 360 (entget ent)))))))
(setq ena (entget (cdr (assoc 360 (entget (cdr (assoc 360 (entget ent))))))))
(setq g 0 lis '())
(repeat (length ena)
(setq itm (nth g ena))
(if (= (car itm) 3)(setq lis (append lis (list (cdr itm)))))
(setq g (+ g 1))
)
(setq g 0 nlis '())
(repeat (length lis)
(setq nlis (append nlis (list (vlax-ldata-get dict (nth g lis)))))
(setq g (+ g 1))
)
(princ)
)

(princ)

 

 

 

Lists have always been my way of organizing information, so I'm attempting to retrieve the string values, of a key, of a dictionary, by entity in a selection set, to store in a list. I've attached a DWG file with the object I'm trying to interact with contained. Thanks in advance!

 

Thanks,

Michael Luckett

0 Likes

Peter2_1,

 

Thank you for the prompt response! I was not aware of these functions, but sadly have not come across a decent example to pick through for my purposes. Maybe you can shed some light on what I may be doing wrong. Though my code may be unconventional, The following is my code so far for this portion

 

 

 

 

(vl-load-com)

(defun c:t ()
(get_intended_objects)
(setq x 0 tlis '())
(repeat (sslength ss)
(get_dictionary_data (ssname ss x))
(setq tlis (append tlis (list nlis)))
(setq x (+ x 1))
)
(princ)
)

(defun get_intended_objects ()
(setq ss (ssget (list (cons -4 "<or")
(cons 0 "point")
(cons -4 "or>")
)))
(princ)
)

(defun get_dictionary_data (ent)
(setq dict (cdr (assoc 3 (entget (cdr (assoc 360 (entget ent)))))))
(setq ena (entget (cdr (assoc 360 (entget (cdr (assoc 360 (entget ent))))))))
(setq g 0 lis '())
(repeat (length ena)
(setq itm (nth g ena))
(if (= (car itm) 3)(setq lis (append lis (list (cdr itm)))))
(setq g (+ g 1))
)
(setq g 0 nlis '())
(repeat (length lis)
(setq nlis (append nlis (list (vlax-ldata-get dict (nth g lis)))))
(setq g (+ g 1))
)
(princ)
)

(princ)

 

 

 

Lists have always been my way of organizing information, so I'm attempting to retrieve the string values, of a key, of a dictionary, by entity in a selection set, to store in a list. I've attached a DWG file with the object I'm trying to interact with contained. Thanks in advance!

 

Thanks,

Michael Luckett

Message 4 of 8
Peter2_1
in reply to: Anonymous

Peter2_1
Collaborator
Collaborator
This is a pure Lisp-topic, so I think when you post to the Lisp-forum you
will find more and better answers.
AutoCAD Map 3D 2023 German / Oracle
0 Likes

This is a pure Lisp-topic, so I think when you post to the Lisp-forum you
will find more and better answers.
AutoCAD Map 3D 2023 German / Oracle
Message 5 of 8
Anonymous
in reply to: Peter2_1

Anonymous
Not applicable

By posting on the Autodesk Map 3D developers forum, I was under the impression that this covers all languages of code that pertains to the software specified. Maybe I've been misdirected... Could you point me in the right direction to post at this rate?

0 Likes

By posting on the Autodesk Map 3D developers forum, I was under the impression that this covers all languages of code that pertains to the software specified. Maybe I've been misdirected... Could you point me in the right direction to post at this rate?

Message 6 of 8
Anonymous
in reply to: Anonymous

Anonymous
Not applicable

Also, I'm trying to utilize the visual lisp extensions specified with no avail... I was kind of wishfully thinking you would know a direction to take, given the source code I've provided. Have you used these functions before?

0 Likes

Also, I'm trying to utilize the visual lisp extensions specified with no avail... I was kind of wishfully thinking you would know a direction to take, given the source code I've provided. Have you used these functions before?

Message 7 of 8
Peter2_1
in reply to: Anonymous

Peter2_1
Collaborator
Collaborator
@ michael.luckettMLFQM

yes, this forum should cover all APIs and therefore your question is not on
the wrong place. It is only at a place which is not as active as other
places (Autodesk Lisp Forum, http://www.theswamp.org/, ..)

Personally, I only used a few lines for Dictionaries some years ago, so I'm
not able to give you a qualified reply.
AutoCAD Map 3D 2023 German / Oracle

@ michael.luckettMLFQM

yes, this forum should cover all APIs and therefore your question is not on
the wrong place. It is only at a place which is not as active as other
places (Autodesk Lisp Forum, http://www.theswamp.org/, ..)

Personally, I only used a few lines for Dictionaries some years ago, so I'm
not able to give you a qualified reply.
AutoCAD Map 3D 2023 German / Oracle
Message 8 of 8
Anonymous
in reply to: Peter2_1

Anonymous
Not applicable
Accepted solution

I appreciate the help, even If you weren't able to provide a solution. I've moved it to this thread, and am sifting through the code from the responses now. Thanks again!

 

https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/read-data-dictionary-entries/m-p/892...

0 Likes

I appreciate the help, even If you weren't able to provide a solution. I've moved it to this thread, and am sifting through the code from the responses now. Thanks again!

 

https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/read-data-dictionary-entries/m-p/892...

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

Post to forums  

Autodesk Design & Make Report