Creating a Floating Line Whose Length is Fixed

Started by Tegglet, October 06, 2013, 09:33:32 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Tegglet

I want to measure the four sides of an area (room or office) and either of the diagonals then in Visio create five lines corresponding to the measured lengths and fix their length.

Providing the length of the lines can be fixed they can be moved and rotated so their ends connect to form an accurate shape representing the measured area.  Easy to do on paper with a pencil and compass but not in Visio.

Any help would be appreciated.

wapperdude

The process is very similar to your "line" problem....

After you draw all of your lines, from the menu bar click on Shape.  From the pop-up menu, mouse over Operations.  New pop-up window click on "join".

Now, with the unified shape still selected, right click and select protection from the pop-up window.  Select width, height, and aspect ratio.  Click OK.

Wapperdude

Visio 2019 Pro

Tegglet

Thanks for your prompt response.

Unfortunately I forgot to mention that I am using Visio Pro 2013.  Microsoft, in their infinite wisdom, have replaced the menus with that infernal ribbon to which I have given an ashtray on a motorbike award.

I have found an "Operations" command and added it to my quick access toolbar but it does not do anything.  I think I am missing a "Developer" tab which I will investigate further in the morning.

Regarding the rest of your instructions, I need to lock or fix the line length and verify that it has not been changed rather than the width, height and aspect ratio of the overall shape.  I find that all to often Visio has done its own thing and changed something that I do not want changed.

It is beginning to look as if this relatively simple task is beyond the capability of Visio, maybe I should go back to pencil, paper and compass. :(

JuneTheSecond

#3
I agree with you.
It is one of the most hard task.
I also tried to make a tool like a compass or divider that can trace on the free curve by many steps.
But failed.
Then I made a constant radius circle with a given line in my geometry tools.
Best Regards,

Junichi Yoda
http://june.minibird.jp/

vojo

Assuming 1D shape, then

BeginX = xxmm
BeginY = yymm
EndX = guard (beginx + props.lengthx)
Endy = guard(beginy + props.lengthy)

Props.lengthx = dx mm
Props.lengthy = dy mm

Eventdblclk = docmd(1312)


JuneTheSecond

Your code is nice.
But this fix not only the length but also angle.
I think we need angle is free.
It is very hard to realize.
Best Regards,

Junichi Yoda
http://june.minibird.jp/

vojo

I thinking locking the endx and endy would fix the angle.
In essence, its sort of like  the end is a fixed offset from the beginning regardess of beginning point

last resort, could have a angle = guard (props.angle)

vojo

The other way you could do this is with a control point

Have a free floating control point

Beginx is free floating
Beginy is free floating

Props.length = zz mm

Scratch.a1 = (ang360(atan2(control.x, controly)/1 deg)* 1 deg      // * 1 deg is real important

Endx = guard(beginx + props.length*cos(scratch.a1))
Endy = guard(beginy + props.length*sin(scratch.a1))

Angle = atan2(scratch.a1)....or.... guard(endy-beginy, endx-beginx)

This how the pie shape works.


wapperdude

Looks like Vojo beat me to the punch. 

Basically, took the same approach using control points.  I remembered an angle measuring shape, so I modified it.  (There's probably clean up that could be done, but this is kinda quick and dirty.)  There are 3 control points: 
  1.)  Controls the angle
  2.)  Controls the length
  3.)  Positions the text which shows the current length and width.

Double click allows you to set precision, change angular degrees, and enter the length.

Could use more work to hide the text.

See attached.

Wapperdude
Visio 2019 Pro

JuneTheSecond

#9
Thank you all.
Your solutions are very good.
But would not satisfy Tegglet.
Please image compass or divider that you would have lerned how to use in junior school.
The Visio control point to guide the direction of the constant length of line should be just on top of this line.
It is very hard task to realize in Visio.
Best Regards,

Junichi Yoda
http://june.minibird.jp/

wapperdude

Actually this does meet the requirements.

The length control point is a "slider" sets the length of the line.  This length is preserved thru all rotations.  The control point does not move with the line.

The angle control point is used to rotate the line.  It is independent of the length.

Draw a circle, centered on the beginning of the line, with radius equal line length.  Push the circle back to view the line.  It should extend from circle center to outer circumference.  Rotate the line.  This will verify that line length is constant.

HTH
Wapperdude
Visio 2019 Pro

vojo

this solves the problem....its how the pie shape works.

In essence, the pie shape radius is constant....the control point defines orientation...and thus how much of the circle is filled in by the pie.
to make the pie larger (increase radius) you use other methods.

All I suggested adding was to allow, via props, to define length

I have done similar, though not exactly the desired behavior here, on may drawings
(alot these shapes I did were based off your iso stuff....real nice work!!!!)


wapperdude

#12
I've updated the shape: 
  1. cleaned out some stuff that wasn't needed
  2. added ability to specify desired angle via double click menu
      It's a little clunky.  Tried unsuccessfully to use setatref functionality.  So, came up with a 2 step process.  Step1:  enter desired angle.  Step 2:  use right click menu and hit the update angle entry.  It works, but, sure would be nice to have a cleaner approach. 

  3.  right click menu allows you to hide the text.

Wapperdude

Ooops.  Found a bug.  Attachment removed.

The file is back.  The original Visio file seems to have same problem, at least on my PC, Win7, V2007.  For thick lines, they tend to disappear when the angle is >90 & < 270.  Thin lines are fine.
Visio 2019 Pro

wapperdude

#13
Solved the line width problem.  One extra line in the geometry section.

Here's updated file.
Visio 2019 Pro

Tegglet

Sorry for the tardy response, I have not been well for the past few days.

Just had a play with wapperdude's solution and it appears to deliver the goods.  I will measure up the area this weekend and try it for real.  I will let you know the result on Monday.

Many thanks to those who contributed, especially JuneTheSecond who latched on to the essence of the problem straight away.  I must admit I did not think the topic would arouse so much activity.