drawio icon indicating copy to clipboard operation
drawio copied to clipboard

Support the length of a line

Open mararad opened this issue 4 years ago • 5 comments

  • It will be very useful if I could get the length of lines without calculating it using e.g 10pt grid and scale 1pt=1cm which works for horizontal and vertical lines but for other line orientations is hard.

  • Add length to (x,y) popup when dragging a line will be helpful. http://cogito-ergo-sum.ru/line.png https://desk.draw.io/a/tickets/11151

line

mararad avatar Dec 25 '20 17:12 mararad

indeed this would be quite must have feature

burner- avatar May 13 '22 18:05 burner-

Was this feature request dropped? i do not see the display of line length in the latest release.

jeffatoptics avatar Sep 12 '22 04:09 jeffatoptics

It was rejected yes. If you prefer I can reopen the issue and nobody implement it.

davidjgraph avatar Sep 12 '22 08:09 davidjgraph

It was rejected yes. If you prefer I can reopen the issue and nobody implement it.

Quite grumpy way to take attitude for good and proper feature request. Is that project dead or what is reason that it wont go to implementation?

burner- avatar Sep 12 '22 10:09 burner-

Lol the last chat is comment is only 10 hours old.

Some questions:

  1. Does anyone know how many story points this feature would require to deploy annnnnd effort to maintain?
  2. Do you know how much it would be to crowd fund this feature on something like https://gitcoin.co/?
  3. Do you think I it will be easier to make a tampermonkey script to fill in this gap? This was my original plan (keep all the automation abstracted (maybe add a bar to the top of the screen to show live numbers and for measurement input, the just push the change once you release the mouse drag is released)

Quite grumpy way to take attitude for good and proper feature request. Is that project dead or what is reason that it wont go to implementation?

We are fully entitled to decline a feature request. I closed the issue to reflect the fact that we don't want to implement this. Reopening it is pointless, as we don't wish to implement the feature.

Your attitude is extremely entitled. Continue and I will ban you from the project for breach of the code of conduct.

davidjgraph avatar Aug 02 '23 13:08 davidjgraph

to support the suggestion, that is what I did in PowerPoint, adding some auxiliary lines to draw the structure. As I can define the length of the lines in mm at least that task is quite simple in PowerPoint image

In draw.io I have to misuse shapes image

PackElend avatar Sep 28 '23 13:09 PackElend

Use %length% placeholder.

davidjgraph avatar Mar 13 '24 12:03 davidjgraph

Use %length% placeholder.

Can I ask you to explain exactly what needs to be done? Where to write %length% ?

DmitryDemidov avatar Mar 13 '24 14:03 DmitryDemidov

  1. Draw an Edge or Line: First, draw the line or connector for which you want to display the length.

  2. Select the Edge or Line: Click on the edge or line to select it.

  3. Access the Text Label: With the edge or line selected, look for the text label area. This is usually activated by double-clicking on the line or edge itself.

  4. Enter the Placeholder: In the label area, enter %length% as the text. This serves as a placeholder that will be replaced by the actual length of the line or edge in your diagram.

  5. Adjust Units (Optional): By default, the length is shown in pixels. If you wish to change the unit of measurement, you might need to use custom properties or look for settings in draw.io that allow changing the default unit of measurement. This might not be directly supported as a feature through placeholders, and could require additional steps or scripts.

  6. View the Length: Once you've entered the placeholder, draw.io should automatically calculate and display the length of the line or edge in place of the %length% placeholder. As you adjust the size or shape of the line, the displayed length should update automatically.

  • Enter the Placeholder: In the label area, enter %length% as the text. This serves as a placeholder that will be replaced by the actual length of the line or edge in your diagram.

I have just tried it but only shows the text, the placeholder is not replaced. Does it work for anyone else?

PackElend avatar Apr 10 '24 19:04 PackElend

  • Enter the Placeholder: In the label area, enter %length% as the text. This serves as a placeholder that will be replaced by the actual length of the line or edge in your diagram.

I have just tried it but only shows the text, the placeholder is not replaced. Does it work for anyone else?

It didn't work for me either, even though I'm sure I'm doing everything right.

Screenshot 2024-04-10 at 23 48 50 Screenshot 2024-04-10 at 23 49 16

DmitryDemidov avatar Apr 10 '24 20:04 DmitryDemidov

Capture d’écran 2024-04-11 à 18 51 41

davidjgraph avatar Apr 11 '24 17:04 davidjgraph

Capture d’écran 2024-04-11 à 18 51 41

Which version draw.io?

DmitryDemidov avatar Apr 12 '24 06:04 DmitryDemidov

24.2.3. If you're using desktop, you just need to wait for a new release.

davidjgraph avatar Apr 12 '24 08:04 davidjgraph

24.2.3. If you're using desktop, you just need to wait for a new release.

Thanks!

DmitryDemidov avatar Apr 12 '24 08:04 DmitryDemidov

24.2.3. If you're using desktop, you just need to wait for a new release.

I am using web version v24.2.3 but It is not replacing with actual length when I use placeholder. image

Gudratliishere avatar Apr 12 '24 15:04 Gudratliishere

Is that the default label of the edge, or a new label you added to the edge?

davidjgraph avatar Apr 12 '24 15:04 davidjgraph

Please attach a test case.

alderg avatar Apr 12 '24 16:04 alderg

No length support in desktop version 24.2.5

Test case:

  1. Draw new line using "General" shapes library
  2. Double click on the new line (or press F2) - to start editing line label
  3. Enter "%length%" (without quotes) and clicking outside line
  4. ER: %length% macro is replaced with real line length value
  5. AR: plain text "%length%" exists

image

exadmin avatar May 08 '24 12:05 exadmin

Just select the line and type that label. If you add a new label to the connector, it's a child shape and doesn't support that property. And make sure you enabled placeholders on that edge.

davidjgraph avatar May 08 '24 13:05 davidjgraph

Thank you. Now succeed!

It was unclear that "placeholders" must be enabled. Correct flow I've found is:

  1. Draw new line
  2. Press Ctrl+M and enable "placeholders" for the line
  3. Use %length% macro

See gif below drawio-1677

exadmin avatar May 08 '24 13:05 exadmin

any chance that the length is shown in paper dimension (mm, inch etc.)?

PackElend avatar May 17 '24 10:05 PackElend