Modify block attributes

Modify block attributes

Anonymous
Not applicable
270 Views
7 Replies
Message 1 of 8

Modify block attributes

Anonymous
Not applicable
I am looking for a command or a lisp routinue that will allow me to
modify the text size in one block without modifying it in other blocks
of the same name
Also looking for a way to stretch entities of a block such as when the
text attribute ends up outside of a text box drawn into the block
THANX
Happy Trails
0 Likes
271 Views
7 Replies
Replies (7)
Message 2 of 8

Anonymous
Not applicable
I don't think you can do that first item. All blocks with the same name
share the definition. As far as I know, there is no way around this except
to create a second block definition.

--
Get free software and more at http://www2.stonemedia.com/franko

"Lonnie Dickerson" wrote in message
news:38D8EA54.B0F39E10@aol.com...
> I am looking for a command or a lisp routinue that will allow me to
> modify the text size in one block without modifying it in other blocks
> of the same name
> Also looking for a way to stretch entities of a block such as when the
> text attribute ends up outside of a text box drawn into the block
> THANX
> Happy Trails
>
0 Likes
Message 3 of 8

Anonymous
Not applicable
You may access individual entities in a block using "nentsel" after which
that entity may be modified using a call to subst and entmod, followed by
either an entupd or regen to see the change. This will work until the
block is redefined within the drawing.

Lonnie Dickerson wrote:

> I am looking for a command or a lisp routinue that will allow me to
> modify the text size in one block without modifying it in other blocks
> of the same name
> Also looking for a way to stretch entities of a block such as when the
> text attribute ends up outside of a text box drawn into the block
> THANX
> Happy Trails
0 Likes
Message 4 of 8

Anonymous
Not applicable
Actually in AutoCAD 2000 you'll need to type '-ATTEDIT' (with the dash in
front of it). For some reason AutoDesk decided to make the ATTEDIT command
work exactly like DDATTE. It's also possible to do this with autolisp as
well.

James Dee
www.caddee.com

Mark E. Fretty wrote in message
news:8bb0om$gms5@adesknews2.autodesk.com...
> Lonnie,
>
> I believe you can use the ATTEDIT command to scale (use the "Height"
option)
> individual attributes of a block.
>
> Lonnie Dickerson wrote in message
> news:38D8EA54.B0F39E10@aol.com...
> > I am looking for a command or a lisp routinue that will allow me to
> > modify the text size in one block without modifying it in other blocks
> > of the same name
> > Also looking for a way to stretch entities of a block such as when the
> > text attribute ends up outside of a text box drawn into the block
> > THANX
> > Happy Trails
> >
>
>
0 Likes
Message 5 of 8

Anonymous
Not applicable
+++++ James Dee www.caddee.com +++++
Try this...

(defun c:ats ( / ent entinf entype)
(while (not (= entype "ATTRIB"))
(if (setq ent (nentsel))
(progn
(setq entinf (entget (car ent)))
(setq entype (cdr (assoc 0 entinf)))
(if (= entype "ATTRIB")
(progn
(command "-attedit" "y" "*" "*" "*" ent "h" (* (cdr (assoc 40 entinf))
0.9) "")
(princ "\nSelected attribute is now 10% smaller.")
);progn
);if
);progn
);if
);while
(princ)
);defun

+++++ James Dee www.caddee.com +++++

Lonnie Dickerson wrote in message
news:38D8EA54.B0F39E10@aol.com...
> I am looking for a command or a lisp routinue that will allow me to
> modify the text size in one block without modifying it in other blocks
> of the same name
> Also looking for a way to stretch entities of a block such as when the
> text attribute ends up outside of a text box drawn into the block
> THANX
> Happy Trails
>
0 Likes
Message 6 of 8

Anonymous
Not applicable
Lonnie,

I believe you can use the ATTEDIT command to scale (use the "Height" option)
individual attributes of a block.

Lonnie Dickerson wrote in message
news:38D8EA54.B0F39E10@aol.com...
> I am looking for a command or a lisp routinue that will allow me to
> modify the text size in one block without modifying it in other blocks
> of the same name
> Also looking for a way to stretch entities of a block such as when the
> text attribute ends up outside of a text box drawn into the block
> THANX
> Happy Trails
>
0 Likes
Message 7 of 8

Anonymous
Not applicable
I rec'd your reply but have not been able to understand it. The command you
stated "nentsel" does not appear to be an AutoCAD command.
Thanx

John Wagner wrote:

> You may access individual entities in a block using "nentsel" after which
> that entity may be modified using a call to subst and entmod, followed by
> either an entupd or regen to see the change. This will work until the
> block is redefined within the drawing.
>
> Lonnie Dickerson wrote:
>
> > I am looking for a command or a lisp routinue that will allow me to
> > modify the text size in one block without modifying it in other blocks
> > of the same name
> > Also looking for a way to stretch entities of a block such as when the
> > text attribute ends up outside of a text box drawn into the block
> > THANX
> > Happy Trails
0 Likes
Message 8 of 8

Anonymous
Not applicable
From the AutoCAD Customization Guide:

Prompts the user to select an object (entity) by specifying a point, and
provides access to the definition data contained within a complex object

(nentsel [msg])

You will need to write a lisp routine to do what you are asking. The
preceding function will allow you to access individual entities within a
block, such as text. You may also change the justification of an
attribute inside of a block using the above function to obtain the
entity list and then use the "subst" functions to replace the desired
value and update the block using "entmod"

(setq EL (entget (car (nentsel "\nSelect imbedded text in block: "))))

(setq EL (subst (cons A_NUM N_VAL) (assoc A_NUM EL) EL))
(entmod EL)

where A_NUM is the number of the group association list:

(assoc item alist)
Searches an association list for an element and returns that
association list entry

and N_VAL is the new value you want to replace the existing value
with.

Appendix C of the AutoCAD Customization Guide is the reference to the
DXF or association codes for entities used in autoCAD
0 Likes