AutoCAD 2013/2014/2015

AutoCAD 2013/2014/2015

Reply
Mentor
matus.brlit
Posts: 246
Registered: ‎03-11-2008
Message 1 of 11 (2,075 Views)
Accepted Solution

Width factor of multiline attribute

2075 Views, 10 Replies
04-28-2013 11:41 PM

I was trying to find out, how to change the width factor of multiline attribute and I failed.

The only way was to change the width factor of texstyle the attribute uses.

Is there a way to override this property for a single attribute? And if not, is there some reason for that?

 

Thanks

Hi,

 

Here is a quick rough routine (without error checking), that can help you:

 

(defun c:CH_ATTR_WIDTH ( / new_width atent atent_list)
(setq new_width (getreal "\nEnter new width factor: "))
(setq atent (car (nentsel "\nSelect multiline attribute to change width factor: ")))
(setq atent_list (entget atent))
(setq atent_list (subst (cons 41 new_width) (assoc 41 atent_list) atent_list ))
(entmod atent_list)
(princ)
)

 

 

How it works:

 

Command: CH_ATTR_WIDTH
Enter new width factor: .8
Select multiline attribute to change width factor:
Command:

 

Maxim

*Expert Elite*
Alfred.NESWADBA
Posts: 9,207
Registered: ‎06-29-2007
Message 2 of 11 (2,037 Views)

Re: Width factor of multiline attribute

04-30-2013 12:57 PM in reply to: matus.brlit

Hi,

 

>> And if not, is there some reason for that?

What should happen when running command _ATTSYNC?

 

Personal opinion: If you do individual character formatting within a text (MTEXT) you will end in having a chance to just change the textstyle to update all texts (and that what text-styles are built for, to just change e.g. a font at one position (the style) to have it done for the whole document).

At least I don't like to do individually character-settings/overwrites within an MTEXT as of that reason.

 

- alfred -

-------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
Mentor
matus.brlit
Posts: 246
Registered: ‎03-11-2008
Message 3 of 11 (2,027 Views)

Re: Width factor of multiline attribute

05-01-2013 01:46 AM in reply to: Alfred.NESWADBA

I think you misunderstood me, I don't want to change width factor of individual characters, I want to change the width factor of the whole text.

The same you can do with single-line attributes, so I'm not worried about ATTSYNC.

Also you can change the width factor of attributes in inserted block using the dialog, but for multiline attributes, the textbox is disabled.

Mentor
greg.battin
Posts: 157
Registered: ‎12-10-2010
Message 4 of 11 (2,017 Views)

Re: Width factor of multiline attribute

05-01-2013 07:16 AM in reply to: matus.brlit

Here is what i use to adjust the width of the text box for Mutliline Attributes.

 

Some client title blocks have Multilines Atts that are FIELDS and run over the borders...

 

I wish that there was a way to use a lisp or script where you select the Multiline Attribute and then set the width of the text box. 

Here's the manual way:

 

Use the EDIT ATTRIBUTES dialog box with the ATTEDIT command or ATE alias
MultiLine ATT 1.jpg

 

Click the "ellipsis" button (button with 3 dots next to the Attribute that you want to adjust

 

MultiLine ATT 2.jpg

 

Drag the 2 arrows in the upper right of the text box window to adjust

 

Multiline ATT 3.jpg

Exit out of the dialog box by clicking OK...

Multiline ATT 4.jpg

~Greg

Mentor
matus.brlit
Posts: 246
Registered: ‎03-11-2008
Message 5 of 11 (1,996 Views)

Re: Width factor of multiline attribute

05-01-2013 11:19 PM in reply to: greg.battin

Thanks Greg, but this is not what I am looking for. You can get the same result by inserting linefeed where you want the next line.

Imagine the rectangle, where you have a 2-line attribute. You can't add a new line to reduce the width, because you are also limited by the height of 2 lines.

 

This is how it looks for single-line attributes

 

singleline.PNG

 

I would like to be able to esit the width factor for multi-line attributes, too.

 

multiline.PNG

*Expert Elite*
maxim_k
Posts: 3,919
Registered: ‎07-22-2010
Message 6 of 11 (1,988 Views)

Re: Width factor of multiline attribute

05-02-2013 02:35 AM in reply to: matus.brlit

Hi,

 

Here is a quick rough routine (without error checking), that can help you:

 

(defun c:CH_ATTR_WIDTH ( / new_width atent atent_list)
(setq new_width (getreal "\nEnter new width factor: "))
(setq atent (car (nentsel "\nSelect multiline attribute to change width factor: ")))
(setq atent_list (entget atent))
(setq atent_list (subst (cons 41 new_width) (assoc 41 atent_list) atent_list ))
(entmod atent_list)
(princ)
)

 

 

How it works:

 

Command: CH_ATTR_WIDTH
Enter new width factor: .8
Select multiline attribute to change width factor:
Command:

 

Maxim

Architect
MARSS

MacACAD | MARSS


Mentor
matus.brlit
Posts: 246
Registered: ‎03-11-2008
Message 7 of 11 (1,983 Views)

Re: Width factor of multiline attribute

05-02-2013 02:52 AM in reply to: maxim_k

great solution, thanks Maxim

Mentor
greg.battin
Posts: 157
Registered: ‎12-10-2010
Message 8 of 11 (1,966 Views)

Re: Width factor of multiline attribute

05-02-2013 07:05 AM in reply to: matus.brlit

Thanks Greg, but this is not what I am looking for. You can get the same result by inserting linefeed where you want the next line.

Imagine the rectangle, where you have a 2-line attribute. You can't add a new line to reduce the width, because you are also limited by the height of 2 lines.

 

Ah - I see

 

Thanks for clarifying. 

 

Cool solution Maxim_k

 

~Greg

Valued Mentor
mbuonocore
Posts: 392
Registered: ‎01-27-2006
Message 9 of 11 (1,953 Views)

Re: Width factor of multiline attribute

05-02-2013 01:15 PM in reply to: matus.brlit

If I understand the question, you could make a textstyle and set the width factor there.   When you make the attribute, assign it that textstyle.  If you need to change the width factor of all the attributes you can change it globally in the textstyle then do an attribute sync.  If you want to change just one or a few attributes you can do it in the attribute editor under the text option tab.  It worked for me in 2013.

 

Please don't forget the "accept the solution" button if this helps.  Thanks

Valued Mentor
mbuonocore
Posts: 392
Registered: ‎01-27-2006
Message 10 of 11 (1,951 Views)

Re: Width factor of multiline attribute

05-02-2013 01:22 PM in reply to: mbuonocore

My bad, you said multiline attribute, my response works directly for single line attributes.  It also works for multiline att's with an extra step.  You can still have the attribute read the textstyle with the width factor set.  However the width factor is only apparent if the text box is expanded as in the other responses.

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.