Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 395
Default Shapes.AddShape msoShapeBlockArc...ShapeRange.Adjustments.Item(1)

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,489
Default Shapes.AddShape msoShapeBlockArc...ShapeRange.Adjustments.Item(1)

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
--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"ker_01" wrote in message
...
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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 395
Default Shapes.AddShape msoShapeBlockArc...ShapeRange.Adjustments.Item

Brilliant!

Thanks Andy!!

Keith

"Andy Pope" wrote:

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
--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"ker_01" wrote in message
...
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ShapeRange.Name mino[_2_] Excel Programming 3 April 11th 08 11:05 AM
Got error in Shapes.AddShape() ramkumar_cpt Charts and Charting in Excel 1 March 15th 06 09:43 AM
Strange Shapes.AddShape error Nick Hebb Excel Programming 1 November 17th 05 10:39 AM
.AddShape(Type, Left, Top, Width, Height) AA2e72E Excel Programming 2 February 2nd 05 01:56 PM
Selection.ShapeRange.IncrementLeft error Anil Khemchandani Excel Programming 0 December 9th 03 07:30 PM


All times are GMT +1. The time now is 11:41 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"