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.
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
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. :(
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.
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)
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.
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)
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.
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
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.
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
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!!!!)
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.
Solved the line width problem. One extra line in the geometry section.
Here's updated file.
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.
I think it's amazing what gets achieved on this forum, so much enthusiasm for Visio. The official Microsoft forums are a total waste of space in comparison.
So JuneTheSecond was on track for the ultimate solution, but the shape jumps around a bit because of ShapeSheet limitations. Visio would need some sort of constraint solver to do this right.
Then Wapperdude got the right idea of decoupling the 1D endpoint handles from the actual geometry.
I've taken Wapperdude's tack to some extent, but with my shape, you use the regular 1D handles to control the angle, and a control handle or shape data to set the line length. So, both the angle and the length can be set either visually or numerically.
To summarize, you can control the attached shape like this:
Angle: Size & Position Dialog, or 1D endpoint handles
Length: Size & Position Dialog, Shape data field or 1D endpoint handles
There one connection point at the end of the line segment, so the beginning of other lines can be glued to it.
You can right-click or use the shape data field to show/hide the length and angle text.
what....no love for my appends on this....I guess I dont get roses anymore ;-)
Seriously...no problem guys....glad it all worked out
Vojo: Carnations OK? Actually, your initial response was what encouraged me to work harder on this.
VisioGuy: Nice finish. Solution is very clean.
For All.
I am very sorry to insist too much about my opinion,
though you have posted many good solutions.
But I am still thinking is there any other alternatives.
Here is an example that can make chain of lines of constant lenght,
or trace free curve with constant length lines.
It uses Dependson function and SetF function in the shapesheet.
Prop.Length = 10 mm
Use.Row_1 = DEPENDSON(Angle,Width)
+SETF(GetRef(EndX),BeginX+Prop.Length*COS(Angle))
+SETF(GetRef(EndY),BeginY+Prop.Length*SIN(Angle))
Of course, it has some defects as listed on attached drawing.