how to NUDGE a shape's size 1 pixel at a time

M

mtplus

Is there a way to NUDGE a shape's size 1 pixel. I know thgat one can change
its position 1 pixel at a time, but I can not find a way to change its size
using NUDGVE.

Thanks
Robert
 
W

wr

Hi Robert,

SHIFT+arrow moves the shape a pixel a time
Checking the event monitor shows this indicated a move of .625 mm in the
PinX or PinY cells
depending on whether the movement is horizontal or vertical
Afcourse if you press the left and down arrow at the same time you get a
more difficult pattern

René
 
M

mtplus

Rene,

I think that the SHIFT+arrow moves the 'whole' shape. I want to
increase or decrease the size of a shape by changing the location of an edge
one pixel at a time.

Thanks,
Robert
 
W

wr

Hi Robert,

codewise that would be something like
============
Sub move()
Dim vshapes As Visio.Shapes
Dim vshape As Visio.Shape
Dim i As Integer
Dim rr As String
Dim cellobj As Visio.Cell
Dim pixel As Integer
Set vshapes = ActivePage.Shapes
fullcount = vshapes.Count
For i = 1 To fullcount
Set vshape = vshapes.Item(i)
If vshape.Name = "move" Then
For pixel = 1 To 10
Set cellobj = vshape.Cells("PinX")
cellobj.Formula = cellobj.ResultStr(visMillimeters)
rr = cellobj.Formula
rr = Val(rr) + "0.625" 'Val(rr)
cellobj.Formula = rr & " mm" '& "0.625 mm"

Next pixel
End If
Next i
End Sub
==============

This macro seacrh for a shape with the name 'move' when found it moves it 10
times to the right
one pixel a time

René
 
W

wr

Hi Robert,

you are right, you asked for reszing not moving

in this case in the macro change as follows to reflect changes in width and
height cell:

===============
Sub resize()
Dim vshapes As Visio.Shapes
Dim vshape As Visio.Shape
Dim i As Integer
Dim rr As String
Dim cellobj As Visio.Cell
Dim pixel As Integer
Set vshapes = ActivePage.Shapes
fullcount = vshapes.Count
For i = 1 To fullcount
Set vshape = vshapes.Item(i)
If vshape.Name = "resize" Then
For pixel = 1 To 10
Set cellobj = vshape.Cells("Height")
cellobj.Formula = cellobj.ResultStr(visMillimeters)
rr = cellobj.Formula
rr = Val(rr) + "0.625" 'Val(rr)
cellobj.Formula = rr & " mm" '& "0.625 mm"

Set cellobj = vshape.Cells("Width")
cellobj.Formula = cellobj.ResultStr(visMillimeters)
rr = cellobj.Formula
rr = Val(rr) + "0.625" 'Val(rr)
cellobj.Formula = rr & " mm" '& "0.625 mm"

Next pixel
End If
Next i
End Sub
=================================

René
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top