TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Pepe on July 01, 2022, 08:21:10 AM
-
I'm developing an small application using ObjectDBX to automatically write the index of a drawing collection to a .txt file (pretty useful when you have more than 100 drawings...).
Titles and numbering are always Mtext (two) with same insertion points throughout the collection and always in paper space.
I've managed to do it by comparing the entities in this space to meet these two conditions (be mtext and same insertion points). It works fine when there is a single layout in the drawing.
I find the problem when the dwg contains several layouts because only are returned data from those entities existing in the active layout when it was saved.
The question is: Is there any way to get the entities of each layout's paper space by means of ObjectDBX?
-
How are you getting the collection of entities?
Not sure if it’s exposed to lisp, but you should be able to get the owner Id and find the layout block table record it belongs to
-
Layouts -> Layout -> Block property
-
Maybe something like this, but for the other document.
(setq tabs (vla-get-Layouts (vla-get-activedocument (vlax-get-acad-object))))
-
For an existing example, consider 'Example 4' on the page for my ObjectDBX Wrapper (http://lee-mac.com/odbxbase.html) function; as Roy has indicated in his earlier post, the key is to iterate over the objects found within the block container for the layout.
-
It works! :yay!: It didn't occurred to me treating layout objects as blocks... (lack of practice and knowledge , I suppose)
Thank you all for the help! 8-)