Shapes fixed move

Started by gregrae, October 10, 2013, 06:08:29 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

gregrae

Can somebody tell me how can I put fixed move for shapes. I have done my own shapes and those have fixed geometry, but now I would like to move this shapes minimum 10 mm. I mean that this 10 mm moves is smallest move shapes can take. And other moves are always 10mm*k where k is 1,2,3,4,

Thank you for advanced!

Jumpy

I don't understand how you want to move the shapes. With the mouse?
You could place a formula in a user defined cell of the shapeheet that uses a SETF function to place a shape always near the nearest multiple of 10mm.

=SETF(GetRef(Width),10*Floor(Width/10))

or, if I understand the definition of the Floor function:

=SETF(GetRef(Width),Floor(Width,10))

JohnGoldsmith

#2
If you're wanting to snap to specific increments then you could use the following in your PinX/Y cells:

=CEILING(SETATREFEXPR(52.5 mm),10 mm)

I've used this before in constraining angles, but there are other approaches such as Chris' use of the BOUND function.

Using CEILING will round up to the next multiple and FLOOR, as @Jumpy suggests below, will go in the opposite direction.  If you want to snap to the nearest multiple then you could use something like:

PinY = ROUND(SETATREFEXPR(64 mm)/User.Multiple,0)*User.Multiple
User.Multiple = 10mm


...where User.Multiple is your increment multiple abstracted out to a separate cell. The SETATREFEXPR function just acts as a placeholder for the incoming value.

Hope that helps.

Best regards

John
John Goldsmith - Visio MVP
http://visualsignals.typepad.co.uk/

Jumpy

After seeing John's post I have to appologize for the bullshit in my previous post, where I'm working to set the Width cell instead of PinX or PinY cell as would be needed for your intention.

I copied it (from my memory) from another problem, where the width of a shape was only allowed in multiples of  a given value.


Between: Since when exists the Bound function? I managed to ignore it all the time and used my more cumbersome approach with SETF...

JohnGoldsmith

Hi Jumpy,

I don't think you need to apologize.  I often look at a question, start answering, and then realize I've interpreted the question incorrectly - also one of the interesting aspects about Visio is how there is usually more than one way to solve a problem.

The BOUND function, though was introduced in Visio 2003 and there's good post over at the old Visio Insights team blog - "Staying in Bounds"

It's a very useful function for constraining (or excluding) a value from a series of ranges, or as Chris used it for a finite number of distinct values.

Best regards

John
John Goldsmith - Visio MVP
http://visualsignals.typepad.co.uk/