Database concepts (Dictionary,
Hello .I don't know am I on the right path here, and
I have a couple of questions.
First, the database.
I create a "private" dictionary in the main dictionary;
(setq my_dict (entmakex '((0 . "DICTIONARY")((0 . AcDbDictionary))))(setq my_dict (dictadd (namedobjdict) "My Dictionary" my_dict))(setq my_dict (cdr (assoc 5 (entget my_dict))))In the last line I assoc entity handle with the var
to use with vlax-ldata-*** functions.
So now I do next;
(vlax-ldata-put my_dict "My List" list)
(my lists are lists of entities obtained with (entget (car (entsel))) lots of them)
And now my lists are associated with that entity handle so I can
exit acad, and find my data when I start it again.
My lists are retieved with dictsearch and that entity handle.
Is this way ok? This is my first question.
(it works fine, but I want to be sure, you know better for sure)
My other question.
If the first question answer is yes only.
Is it possible to use that saved data from another
drawing?
Thats it, thank you for reading and helping and everithing.
My english sucks, it is hard to me to explane, and I can
imagine what is like to understand this for you
Greetings !
p.s. I have used the search option
but I couldnt find nothing, I am very sorry. Your fist three lines isn't no need, because vlax-ldata-put creates dictionary and XRecord automatically. Try in command line:
Command: (vlax-ldata-put "My Dictionary2" "My List" '(1 2 3 4))(1 2 3 4)
Now check the "My Dictionary2" dictionary existance:
Command: (entget(namedobjdict))((-1 . ) (0 . "DICTIONARY") (330 . ) (5 . "C") (100 . "AcDbDictionary") (280 . 0) (281 . 1) (3 . "ACAD_COLOR") (350 . ) (3 . "ACAD_GROUP") (350 . ) (3 . "ACAD_IMAGE_DICT") (350 . ) (3 . "ACAD_IMAGE_VARS") (350 . ) (3 . "ACAD_LAYOUT") (350 . ) (3 . "ACAD_MATERIAL") (350 . ) (3 . "ACAD_MLEADERSTYLE") (350 . ) (3 . "ACAD_MLINESTYLE") (350 . ) (3 . "ACAD_PLOTSETTINGS") (350 . ) (3 . "ACAD_PLOTSTYLENAME") (350 . ) (3 . "ACAD_SCALELIST") (350 . ) (3 . "ACAD_TABLESTYLE") (350 . ) (3 . "ACAD_VISUALSTYLE") (350 . ) (3 . "My Dictionary2") (350 . ))
As you can see the dictionary has been automatically added.
Of course yes. Again in command line. For example you have open Drawing1.dwg with "My Dictionary2" dictionary. Try from another drawing to get documents collection:
Command: (setq dCol(vla-get-Documents(vlax-get-acad-object)))#
Get object of Drawing1.dwg:
Command: (setq cDoc(vla-Item dCol "Drawing1.dwg"))#
Get dictionaries collection:
Command: (setq dicts(vla-get-Dictionaries cDoc))#
Get object of "My Dictionary2" dictionary:
Command: (setq di2(vla-Item dicts "My Dictionary2"))#
Successfully. Extract first record:
Command: (setq cRec(vla-Item di2 0))#
Check data inside:
Command: (entget(vlax-vla-object->ename cRec))((-1 . ) (0 . "VLO-VL") (5 . "14D") (102 . "{ACAD_REACTORS") (330 . ) (102 . "}") (330 . ) (100 . "vlo_VL") (90 . -64512) (91 . 9) (92 . 0) (300 . "(1 2 3 4)"))
It of course very simplified example without any checkups. ThankYou Mr.Asmi you are the king
页:
[1]