Deteremine the ArrowPoint for 1D Shapes

Started by mirageservo, May 08, 2018, 05:37:45 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

mirageservo

Hi All,

Anybody had the chance to encounter the need to determine to which an arrowpoint is currently pointed in 1D shapes,

Eg.

(a) <---- pointer is at visBegin
(b) ----> pointer is at visEnd
(c) <----> pointer is at both visBegin and visEnd

My purpose is to change the color of the shapes according to the arrow point, eg. shape whose arrow pointing to (a) would be colored with red, while those with (b) will be blue and (c) as gray, something like that.

I can already get the visBegin/viEnd but I don't know where to look for the arrow end point.

Please help.


bhughes89

#2
See attached example.

The shape on the page has Actions (right click) to set a User-Defined cell User.Arrows to either:

  • 0 = no arrows
  • 1 = arrow at beginning
  • 2 = arrow at end
  • 3 = both arrows

From there you just use the Index function (MSDN link) to set the LineColor, BeginArrow, and EndArrow cells as shown below. I used the User-Defined cell User.ShapeColor as a middle-man to set the line color, in case you want to set other cells to use the same color format (like FillForegnd).

EDIT: Also, if you want to use a different type of arrow head, just change the number 4's in the BeginArrow and EndArrow formulas to whatever # you prefer.


User.ShapeColor = INDEX(User.Arrows,"=RGB(0,0,0);=RGB(255,0,0);=RGB(0,112,192);=RGB(166,166,166)",,0)
...

*** Line Format Section ***
LineColor = GUARD(User.ShapeColor)
...
BeginArrow = GUARD(INDEX(User.Arrows,"0;4;0;4",,0))
EndArrow = GUARD(INDEX(User.Arrows,"0;0;4;4",,0))