Nested block & entities that belong to a block
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
Nested block & entities that belong to a block

 
Post new topic   Reply to topic    CADForums.net Forum Index -> Customization
Author Message
Gustavo Guidi
Guest





Posted: Tue Jan 11, 2005 6:12 am    Post subject: Nested block & entities that belong to a block Reply with quote

How can I know the entities that a block is made of (that's a way to know
even if a block is nested)
Thanks

--
Gustavo Guidi
g_e_guidi@yahoo.com.ar

Back to top
Bill DeShawn
Guest





Posted: Tue Jan 11, 2005 9:29 am    Post subject: Re: Nested block & entities that belong to a block Reply with quote

One way:
If you suspect that an object within a block is another block you can list
it with XLIST.

You can use REFEDIT, pick everything in the block and then list everything
in the block.

You can explode a block, list all P(revious) objects, and then undo the
explode.



You are much more capable than you think!

--
Bill DeShawn
bdeshawn@nospamsterling.net
http://my.sterling.net~bdeshawn

"Gustavo Guidi" <gguidi@powernet.net.ar> wrote in message
news:41e3277c_2@newsprd01...
Quote:
How can I know the entities that a block is made of (that's a way to know
even if a block is nested)
Thanks

--
Gustavo Guidi
g_e_guidi@yahoo.com.ar

Back to top
Jason Piercey
Guest





Posted: Tue Jan 11, 2005 8:23 pm    Post subject: Re: Nested block & entities that belong to a block Reply with quote

Not sure if this is the proper way to handle this
type of thing. If anyone knows a better way,
please share.


; Function to determine if a given object
; is nested in a block/insert definition.
; Arguments:
; [object] - vla-object
; return values: t, nil, or error message
; Example:
;(nestedObject-p (vlax-ename->vla-object (car (nentsel))))
(defun nestedObject-p (object)
(not
(wcmatch
(vla-get-name
(vla-objectidtoobject
(vla-get-document object)
(vla-get-ownerid object)))
"`*Model_Space,`*Paper_Space")) )


Comments anyone?

--
Autodesk Discussion Group Facilitator



"Gustavo Guidi" <gguidi@powernet.net.ar> wrote in message
news:41e3277c_2@newsprd01...
Quote:
How can I know the entities that a block is made of (that's a way to know
even if a block is nested)
Thanks

--
Gustavo Guidi
g_e_guidi@yahoo.com.ar



Back to top
Luis Esquivel
Guest





Posted: Tue Jan 11, 2005 8:46 pm    Post subject: Re: Nested block & entities that belong to a block Reply with quote

Is this what you, are looking for?.... hth

(defun dxf (g e)
(cond
((= (type e) 'ename) (cdr (assoc g (entget e))))
((= (type e) 'list) (cdr (assoc g e)))))

;; scan a ename block and return a list of type and ename
;; (scanblock-lst blk)
;; (("TEXT" <Entity name: 7ef57ec0>)
;; ("LINE" <Entity name: 7ef57ec8>)
;; ("CIRCLE" <Entity name: 7ef57ed0>)
;; ("LWPOLYLINE" <Entity name: 7ef57ed8>))
(defun scanblock-lst (blk / enext entnames)
(setq enext
(cdr
(assoc
-2
(tblsearch
"block"
(dxf 2 (entget blk))))))
(while enext
(setq entnames
(cons (list (dxf 0 (entget enext)) enext)
entnames))
(setq enext (entnext enext)))
(reverse entnames))

--
For free AutoLisp/Visual Lisp resources go to:
http://www.draftteam.com/free.php?&lang=en


"Gustavo Guidi" <gguidi@powernet.net.ar> wrote in message
news:41e3277c_2@newsprd01...
Quote:
How can I know the entities that a block is made of (that's a way to know
even if a block is nested)
Thanks

--
Gustavo Guidi
g_e_guidi@yahoo.com.ar

Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> Customization All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Contact Us
Powered by phpBB