Author Topic: Layouts and ObjectDBX  (Read 335 times)

0 Members and 1 Guest are viewing this topic.

Pepe

  • Newt
  • Posts: 84
Layouts and ObjectDBX
« 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?

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 7323
  • AKA Daniel
Re: Layouts and ObjectDBX
« Reply #1 on: July 01, 2022, 09:40:07 PM »
How are you getting the collection of entities?
Not sure if its exposed to lisp, but you should be able to get the owner Id and find the layout block table record it belongs to
Retired

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Layouts and ObjectDBX
« Reply #2 on: July 02, 2022, 07:29:23 AM »
Layouts -> Layout -> Block property

BIGAL

  • Swamp Rat
  • Posts: 1037
  • 40 + years of using Autocad
Re: Layouts and ObjectDBX
« Reply #3 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))))



A man who never made a mistake never made anything

Lee Mac

  • Seagull
  • Posts: 12696
  • London, England
Re: Layouts and ObjectDBX
« Reply #4 on: July 03, 2022, 07:06:34 AM »
For an existing example, consider 'Example 4' on the page for my ObjectDBX Wrapper 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.

Pepe

  • Newt
  • Posts: 84
Re: Layouts and ObjectDBX
« Reply #5 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-)