I’m working on a LISP routine and I was wondering if your wisdom can be called upon?
In my Generic AutoCAD I have some datalink tables from an excel file.
Sometimes we rev the excel file and the name changes, but the referenced cells do not change.
The datalink path is stored in a library file.
You can find the list of the Library files with this Lisp:
(defun c:ListDictionaries ( / ed ed1)
(prompt "\nDictionaries in current drawing: ")
(foreach ed (entget (namedobjdict))
(progn
(cond ((= (car ed) 3)
(prompt (strcat "\n" (cdr ed))))
((= (car ed) 350)
(progn
(foreach ed1 (entget (cdr ed))
(if (= (car ed1) 3)
(prompt (strcat "\n " (cdr ed1)))
)
)
))
)
)
)
(princ)
)
LISTDICTIONARIES
Dictionaries in current drawing:
ACAD_CIP_PREVIOUS_PRODUCT_INFO
ACAD_COLOR
ACAD_DATALINK
Hello
ACAD_DETAILVIEWSTYLE
Imperial24
ACAD_GROUP
ACAD_LAYOUT
Layout1
Layout2
Model
……. Etc…
This shows the name of the Datalink I made (It is called “Hello”)
Furthermore I can look into the database format with the following:
(setq newdictlist (dictsearch (namedobjdict) "acad_datalink"))
((-1 . <Entity name: 2207b6e9e70>) (0 . "DICTIONARY") (5 . "237") (102 . "{ACAD_REACTORS") (330 . <Entity name: 2207b6eb8c0>) (102 . "}") (330 . <Entity name: 2207b6eb8c0>) (100 . "AcDbDictionary") (280 . 1) (281 . 1) (3 . "Hello") (360 . <Entity name: 2207b6e9e80>))
The sub-object (3 . “Hello”) is listed.
Now in my mind I should be able to dig deeper into 3 . “Hello” and possibly pull up the file name it was created from… Then I should be able to tunnel down into the file path…
I know you cannot use ENTGET on a Library file entry so start the tunneling to find and eventually change the file name / path.
Do you know how I can do this?