Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Modify non-attribute entities of an INSERT

2 REPLIES 2
Reply
Message 1 of 3
Victor_Barrage
403 Views, 2 Replies

Modify non-attribute entities of an INSERT

I have a drawing in which I have inserted several instance of a BLOCK. The BLOCK is made up of 3 LINE entities and 4 attributes.

 

Now that the block is inserted, I wish to modify the location of the LINE entities in each INSERT of the block independently. Hence I do not wish to redefine the block.

 

I am able to return all the sub-entites that make up the BLOCK by using a combination of 'TBLSEARCH' and 'ENTNEXT'. And I am able to modify the values and insertion points of the attributes for each individual INSERT. However I don't seem to be able to return any sub-entities of an INSERT that aren't attributes.

 

Can I change the insertion point of the LINE entities separately in each reference to the block? I hope my question makes sense.

Tags (1)
2 REPLIES 2
Message 2 of 3
Shneuph
in reply to: Victor_Barrage

If your block instance is ENT then  (entnext ent) and so on will only return Attribute entities as you have discovered until it reaches the sequend which is the end of the block entities.  There is no way to make lines in a basic block differ between instances (that I know of).  That is just the nature of the Block Definition / Block Instance relationship.  You could probably do what you want with a dynamic block with 'move' parameters though.  I'd look into that.

---sig---------------------------------------
'(83 104 110 101 117 112 104 64 71 109 97 105 108 46 99 111 109)
Message 3 of 3


@Victor_Barrage wrote:

.... 

I am able to return all the sub-entites that make up the BLOCK by using a combination of 'TBLSEARCH' and 'ENTNEXT'. And I am able to modify the values and insertion points of the attributes for each individual INSERT. However I don't seem to be able to return any sub-entities of an INSERT that aren't attributes.

 

Can I change the insertion point of the LINE entities separately in each reference to the block? I hope my question makes sense.


As Schneuph said, the direct answer is no.

 

To affect objects in all insertions, you can get to the non-attribute sub-entities this way:

(setq item (cdr (assoc -2 (entget (tblobjname "block" "YourBlockName")))))

will get you the first sub-entity in the definition.  Then:

(setq item (entnext item))

repeatedly will get you the rest of them, until that returns nil.

 

But you can't change anything about any of them without having it equally affect all insertions of that Block.

Kent Cooper, AIA

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost