Line length in label?

H

Heather Mills

Is there any way for me to get the length of a line to be displayed in
the label field (or anywhere)? I would like to be able to draw a line
between 2 points and have the line label display the length -- like
one of the dimension objects do. I'd use them, but they are more
difficult to control.
 
P

Paul Herber

Is there any way for me to get the length of a line to be displayed in
the label field (or anywhere)? I would like to be able to draw a line
between 2 points and have the line label display the length -- like
one of the dimension objects do. I'd use them, but they are more
difficult to control.

If this is for a straight line shape (rather than a connector) then it is quite easy.
Select the shape, then menu Insert -> Field -> Geometry -> Width
 
H

Heather Mills

If this is for a straight line shape (rather than a connector) then it is quite easy.
Select the shape, then menu Insert -> Field -> Geometry -> Width

Thank you very much...just what I needed.
 
H

Heather Mills

If this is for a straight line shape (rather than a connector) then it is quite easy.
Select the shape, then menu Insert -> Field -> Geometry -> Width

Is there any way to get more than one field inserted in the same
object? Can I get both the length and width for a rectangle? I can get
one, but when I insert the other, it replaces the first one.

It also replaces any text that I already had for that object. This is
not a huge problem unless I need to change the format of the field.
Then I have to replace the text, too. Is there any way to avoid that?
 
H

Heather Mills

Is there any way to get more than one field inserted in the same
object? Can I get both the length and width for a rectangle? I can get
one, but when I insert the other, it replaces the first one.

It also replaces any text that I already had for that object. This is
not a huge problem unless I need to change the format of the field.
Then I have to replace the text, too. Is there any way to avoid that?

I found the Insert Custom Formula feature. I was able to get both the
height and width using this formula:

="Hgt="&FORMAT(Height,"0.00")&", Wid = "&FORMAT(Width,"0.00")

Is there a better way?

I also discovered how to force a linefeed using CHAR(10):

="Hgt="&FORMAT(Height,"0.00")&char(10)&"Wid="&FORMAT(Width,"0.00")

Is there a better way?
 
P

Paul Herber

I found the Insert Custom Formula feature. I was able to get both the
height and width using this formula:

="Hgt="&FORMAT(Height,"0.00")&", Wid = "&FORMAT(Width,"0.00")

Is there a better way?

I doubt it, looks about right to me.

I also discovered how to force a linefeed using CHAR(10):

="Hgt="&FORMAT(Height,"0.00")&char(10)&"Wid="&FORMAT(Width,"0.00")

Is there a better way?

No, look good as well.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top