Author Topic: Drop down guides while moving a control point?  (Read 325 times)

0 Members and 1 Guest are viewing this topic.

along

  • Newbie
  • *
  • Posts: 5
Drop down guides while moving a control point?
« on: June 29, 2020, 04:36:11 AM »
Hi all!

I'm trying to create a smart shape for a square wave in which I can easily move the waves (change amplitude, duration of different parts of the signal).

Is there a way to have a geometry shown only while dragging a control point? I want to see where does the control point (e.g., the rising of the square wave signal) is located with respect to the X axis (or both axes). I know how to make a geometry show are hide in the shape sheet, but couldn't figure out how to tie it to the event of holding/releasing a control point.

Example is attached (also included is a fun light-diffraction smart shape I recently made, as a small token of my appreciation :) ).

Thanks,

Alon

vojo

  • Hero Member
  • *****
  • Posts: 1512
Re: Drop down guides while moving a control point?
« Reply #1 on: June 29, 2020, 06:46:17 AM »
I for one, still don't understand what you are trying to accomplish RE control point.

Are you trying to stretch/shrink the function using a control point.

if you want to show/hide the control point,  then, in the controls section

to show  X behavior = <5    //0 thru 4 shows different offsets
to hide  X behavior = >4        //5 thru 9 same offsets but control point hidden

Same with Y behavior

please provide more detail

Paul Herber

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2927
    • Paul Herber's website
Re: Drop down guides while moving a control point?
« Reply #2 on: June 29, 2020, 09:00:05 AM »
The only shapes I know of that do something similar are the Plan shapes, which uses an addin to create the functionality. The addin detects the shape selected event and sets the shape's cell User.visBESelected. This cell is used to allow various parts of the shape to be made visible/invisible.
Electronic and Electrical engineering, business and software stencils and applications for Visio -

https://www.paulherber.co.uk/

along

  • Newbie
  • *
  • Posts: 5
Re: Drop down guides while moving a control point?
« Reply #3 on: June 29, 2020, 09:55:53 AM »
Thanks Vojo, Paul.

I'm not sure it's possible, but to clarify what I want I added a small diagram with my shape so far.
What I would like to happen (if possible) is that when I select the control point marked with the red hand-drawn arrow, the blue dashed lined would appear until I'll release the control point, so that I can move it to the correct location.

thanks.

vojo

  • Hero Member
  • *****
  • Posts: 1512
Re: Drop down guides while moving a control point?
« Reply #4 on: June 29, 2020, 04:56:33 PM »
oh...ok

1) So in the drawing, add geometries for the blue lines
      sheet.<guide1>!Geometryn.x1 = sheet.<C1>!controls.guide 1   sheet.<G1>!geometryn.y1 =sheet.<C1>!controls.guide1.y
      sheet.<guide1>!geometryn.x2 = geometryn.x1     sheet.<guide1>!geometryn.y2 = Sheet.<axis>!geometryn.y1>
      A series of vertical lines from control points to axis
      since different color...maybe a series of shapes in a group
2) set up actions so that right click can pick what you want
      actions.C1 = setf(getref(actions.c1.checked), if(actions.c1.checked,0,1))
      control point 1 behavior = if (actions.c1.checked,0,1)    same for y
      in vertical line geometrye…...noshow = if(actions.c1.checked, 1, 0)   // it has inverse behavior

so user can right click and select "show C1"...that will show the control point and the vertical line.
user deslects by right click and noting a "check mark" next to "show C1"

you could try to play with a delta between "old C1" and "new C!" but be careful since the cells like user.deltac1X and Y
would be updated for every 0.0001 change in C....lots of cycles.

or use actions to turn on all "Cs"....when done, use actions to turn off all "Cs" veritical lines

Paul Herber

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2927
    • Paul Herber's website
Re: Drop down guides while moving a control point?
« Reply #5 on: June 30, 2020, 05:44:25 AM »
The only shapes I know of that do something similar are the Plan shapes, which uses an addin to create the functionality. The addin detects the shape selected event and sets the shape's cell User.visBESelected. This cell is used to allow various parts of the shape to be made visible/invisible.

I've found that much of this functionality breaks if you start selecting any of the shape sub-shapes, in particular via the Document Explorer window. The dimension lines stop appearing completely, so a bit of a bug in there somewhere!
Electronic and Electrical engineering, business and software stencils and applications for Visio -

https://www.paulherber.co.uk/

along

  • Newbie
  • *
  • Posts: 5
Re: Drop down guides while moving a control point?
« Reply #6 on: July 01, 2020, 04:32:46 AM »
Thanks Vojo, Paul,

I've implemented Vojo's suggestions. I even used infinitelines instead of blue lines, under the moto "Ugly but useful is useful" (contrary to my usual self).

I've included what I've got so far, in case it'd be useful to the future novice reader.

Thanks!