Visio Guy

Visio Guy Website & General Stuff => User-submitted Stuff => Topic started by: JuneTheSecond on January 08, 2016, 12:09:57 AM

Title: Angle Line using SETATREF function
Post by: JuneTheSecond on January 08, 2016, 12:09:57 AM
Here is a Visio drawing of Angle Line.
Angle is fixed unless otherwise you change shape data.
Here are 2 shapes, one has simple shape data, another has shape data in the type of editable dropdown list.

SETATREF function are used to define end point of line.
EndX = SETATREF(User.DeltaX,SETATREFEVAL(SETATREFEXPR(128.5673 mm)-BeginX))*0+BeginX+User.Len*User.Cos
EndY = SETATREF(User.DeltaY,SETATREFEVAL(SETATREFEXPR(218.4292 mm)-BeginY))*0+BeginY+User.Len*User.Sin

I spent time to find the point to use and kill SETATREF function by *0.
Title: Re: Angle Line using SETATREF function
Post by: wapperdude on January 08, 2016, 04:12:08 AM
Brilliant!   ;D
Title: Re: Angle Line using SETATREF function
Post by: wapperdude on January 08, 2016, 04:18:54 AM
Hmmmm.  It does do something funky if you try to connect to the line end.  Begin is OK, just the End is a problem.

Still Brilliant, though.

Wapperdude
Title: Re: Angle Line using SETATREF function
Post by: JuneTheSecond on January 08, 2016, 07:04:39 AM
Thanks, and really strange!
Title: Re: Angle Line using SETATREF function
Post by: wapperdude on January 08, 2016, 07:44:45 AM
I didn't watch the shapesheet, but I suspect Visio is trying to write a new formula to the End X, Y cells and the SETATREF is finding that to be most disagreeable.

Title: Re: Angle Line using SETATREF function
Post by: JuneTheSecond on January 12, 2016, 12:42:03 AM
Thank you, wapperdude.

Now, fixed it. Added PNTX and PNTY functions.
EndX = SETATREF(User.DeltaX,SETATREFEVAL(PNTX((SETATREFEXPR(141.5204 mm)))-BeginX))*0+BeginX+User.LEN*User.COS
EndY = SETATREF(User.DeltaY,SETATREFEVAL(PNTY(SETATREFEXPR(216.6769 mm))-BeginY))*0+BeginY+User.LEN*User.SIN