Shapes.AddShape msoShapeBlockArc...ShapeRange.Adjustments.Item(1)

K

ker_01

I create a sample BlockArc using:
Sub MakeMyArc()
Sheet1.Range("F6").Worksheet.Shapes.AddShape msoShapeBlockArc, 200, 200,
100, 100
End Sub

Now I want to use the adjustments item(1) to make it the desired size
Sub ResizeIt
ActiveSheet.Shapes("AutoShape 1").Select
Selection.ShapeRange.Adjustments.Item(1) = 2
End Sub

I've tried different values for Item(1), and get all sorts of weird
behavior. Sometimes the whole shape "flips" to the other side of the
(imaginary) circle, and in my testing I can't tell if I should be using
values between 0-1, 0-100, 0-360, etc.

I also (because I can't figure out the pattern in the shape changes) don't
know if the Adjustments.Item(1) is a final value assigned, or if it is a
percentage that is calculated against the existing value, etc.

If anyone has worked with msoShapeBlockArc and could explain to me how to
use Item(1) to create a wedge of a desired size, I'd really appreciate it.

For example:
Initial wedge is created as a half-circle (top half). I'll worry about
rotation later, but for now I want to change it so that it changes with each
loop, for example:
Loop1: wedge is 90 degrees of the circle (25%)
Loop2: wedge is 36 degrees of the circle (10%)
Loop3: wedge is 270 degrees of the circle (75%)
then finally, back to the original size of 180 degrees (50%)

Any information about how Adjustments.Item(1) works would be greatly
appreciated!!

Thank you,
Keith
 
A

Andy Pope

Hi,

This is for xl2007 but you should find it helpful.
http://www.andypope.info/tips/tip013.htm

On the sheet, Adjust3, you will need to alter the values in J7 and J8 as
currently they are too small for the Arc shape.
Remove the division by 100. You should then see the values for Item(1) and
Item(2) are in the 0 to 360 range. Defining start and finish angles in
relation to zero at the 3 o'clock position going clockwise.

Arc on top would be Item(1)=180 Item(2)=0
Arc on bottom would be Item(1) =360 Item(2)=180

Cheers
Andy
 
K

ker_01

Brilliant!

Thanks Andy!!

Keith

Andy Pope said:
Hi,

This is for xl2007 but you should find it helpful.
http://www.andypope.info/tips/tip013.htm

On the sheet, Adjust3, you will need to alter the values in J7 and J8 as
currently they are too small for the Arc shape.
Remove the division by 100. You should then see the values for Item(1) and
Item(2) are in the 0 to 360 range. Defining start and finish angles in
relation to zero at the 3 o'clock position going clockwise.

Arc on top would be Item(1)=180 Item(2)=0
Arc on bottom would be Item(1) =360 Item(2)=180

Cheers
Andy
 

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