(vl-load-com)
(defun fun_is-ent-visible (doc ent / layer) ;|
* Проверяет, видим ли примитив (BlockRef)
* Параметры вызова:
doc указатель на документ примитива
ent собственно примитив
|;
(and (equal (vla-get-visible ent) :vlax-true)
(cond ((= (type
(setq layer (vl-catch-all-apply (function (lambda () (vla-item (vla-get-layers doc) (vla-get-layer ent))))))
) ;_ end of type
'vla-object
) ;_ end of =
(and (equal (vla-get-layeron layer) :vlax-true) (equal (vla-get-freeze layer) :vlax-false))
)
((/= (type layer) 'vla-object) t)
) ;_ end of cond
) ;_ end of and
) ;_ end of defun
(defun get-model-space (/ lst)
(vlax-for ent (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object)))
(if (and (wcmatch (strcase (vla-get-objectname ent)) "*BLOCKREF*") (fun_is-ent-visible ent))
(setq lst (cons ent lst))
) ;_ end of if
) ;_ end of vlax-for
lst
) ;_ end of defun
(defun get-all-spaces (/ lst)
(vlax-for blk_def (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object)))
(if (equal (vla-get-islayout blk_def) :vlax-true)
(vlax-for ent blk_def
(vlax-for ent (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object)))
(if (and (wcmatch (strcase (vla-get-objectname ent)) "*BLOCKREF*") (fun_is-ent-visible ent))
(setq lst (cons ent lst))
) ;_ end of if
) ;_ end of vlax-for
) ;_ end of vlax-for
) ;_ end of if
) ;_ end of vlax-for
lst
) ;_ end of defun