Author Topic: digging in the paper space  (Read 1673 times)

0 Members and 1 Guest are viewing this topic.

DEVITG

  • Bull Frog
  • Posts: 481
digging in the paper space
« on: April 05, 2008, 08:53:19 AM »
By this

File_name is "F:\\lisp\\xxxx\\room 004.dwg"
 

   
Code: [Select]
   (setq odbx (vlax-get-or-create-object
(strcat "ObjectDBX.AxDbDocument."
(substr (getvar "ACADVER") 1 2))))

   
    (vla-open odbx file_name)

(setq model (vla-get-modelspace odbx))

    (setq each-at (vla-item model 2))


I can get  an object , and by

         
Code: [Select]
(vlax-for each-at  model 
I can loop to each object to work on it , as to check for text and do a search
 

How can I do the same with objects at each Paper space layouts ??







Location @ Córdoba Argentina Using ACAD 2019  at Window 10

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: digging in the paper space
« Reply #1 on: April 05, 2008, 09:37:38 AM »
Try this:
Code: [Select]
(vlax-map-collection
  (vla-get-PaperSpace
    (vla-get-ActiveDocument (vlax-get-Acad-Object)))
  'vlax-dump-object
)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

gile

  • Gator
  • Posts: 2507
  • Marseille, France
Re: digging in the paper space
« Reply #2 on: April 05, 2008, 09:49:15 AM »
Salud,

You can iterate through the layouts collection.
Each layout is almost  constituted by two objects : a plot configuration (layout object) and a block which countains the graphical objects (viewports...)

The following example print all graphical objects for each layout of the document

Code: [Select]
(vlax-for layout (vla-get-Layouts odbx)
  (and (/= (setq name (vla-get-Name layout)) "Model")
       (princ (vla-get-Name layout))
       (vlax-for obj (vla-get-Block layout)
(print (vla-get-ObjectName obj))
       )
       (terpri)
  )
)
Speaking English as a French Frog

DEVITG

  • Bull Frog
  • Posts: 481
Re: digging in the paper space
« Reply #3 on: April 05, 2008, 10:21:26 AM »
Gile , I got it , thanks for it .




Location @ Córdoba Argentina Using ACAD 2019  at Window 10