access the members of a INSERT-entity

FloriB

Usenet Archive
Joined
Jul 31, 2003
Messages
3
Reaction score
0
hello, i hope someone can help me with this problem. want to access the items that are included in a block (INSERT). but therefore i need to get the address of those items (dxf-code -1). already tried it this way: (setq memberitem (entnext blockitem)) but it didn't work.
does anyone have a solution?
 
First, are you sure you want to access the entities within the INSERT or do you want to access the entities within the block definition that make up the INSERT? In either case the following function will work. Just feed it the ename of a block or insert.

; Jason Piercey . June 2nd, 2003
; get list of sub entity names
; [ename] - entity name or vla-object - block, insert or polyline ; [filter] - string, re: wcmatch ; return: list of enames or nil ; revised: July 10th, 2003 - accepts ename or vla-object (defun nEnts (ename filter / data ent rtn) (or (= 'ename (type ename)) (setq ename (vlax-vla-object->ename ename)) ) (setq filter (strcase filter)) (while (and ename (setq ename (entnext ename))) (setq data (entget ename)) (setq ent (cdr (assoc 0 data))) (if (wcmatch ent filter) (setq rtn (cons ename rtn)) ) (if (= "SEQEND" ent) (setq ename nil)) ) (reverse rtn)
)

For an insert:
(nEnts (car (entsel "\nselect an insert: ")) "*")

For a block definition of an insert
(setq name (cdr (assoc 2 (entget (car (entsel "\nselect an insert: ")))))) (nEnts (tblobjname "block" name) "*")

PS: the above example were typed on the fly, so it
wouldn't hurt to check them over.

FloriB said:
hello, i hope someone can help me with this problem. want to access the items that are
included in a block (INSERT). but therefore i need to get the address of those items (dxf-code -1). already tried it this way: (setq memberitem (entnext blockitem))
 

Latest threads

Back
Top