TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Pepe on July 01, 2022, 08:21:10 AM

Title: Layouts and ObjectDBX
Post 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?
Title: Re: Layouts and ObjectDBX
Post by: It's Alive! on July 01, 2022, 09:40:07 PM
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
Title: Re: Layouts and ObjectDBX
Post by: roy_043 on July 02, 2022, 07:29:23 AM
Layouts -> Layout -> Block property
Title: Re: Layouts and ObjectDBX
Post by: BIGAL on July 02, 2022, 10:41:55 PM
Maybe something like this, but for the other document.

(setq tabs (vla-get-Layouts (vla-get-activedocument (vlax-get-acad-object))))



Title: Re: Layouts and ObjectDBX
Post by: Lee Mac on July 03, 2022, 07:06:34 AM
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.
Title: Re: Layouts and ObjectDBX
Post by: Pepe on July 04, 2022, 09:27:28 AM
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-)