Desperate for AddNodes msoSegmentCurve Help
Zone,
I'm not sure what help you need, but you inspired me to dust off my algebra
and draw a circle. I'd never coded a shape before, so first I read help,
then turned on the macro recorder and drew some curves to see how it works.
I'm not sure what the difference between "auto" and "corner" is. X and Y
are obviously coordinates - here I calculated them as the points in the
circumference:
Sub draw_circle()
Dim free_form As Shape
Dim ctr As Double
Dim rad As Double
Dim known_side As Single
For Each free_form In ActiveSheet.Shapes
free_form.Delete
Next free_form
ctr = 150
rad = 100
With ActiveSheet.Shapes.BuildFreeform(msoEditingAuto, ctr - 100, ctr -
unknown_side(rad, -100))
For known_side = -99 To 100
.AddNodes msoSegmentCurve, msoEditingAuto, (ctr + known_side),
(ctr - unknown_side(rad, known_side))
Debug.Print "k " & known_side & " u " & unknown_side(rad,
known_side)
Next known_side
For known_side = -100 To 100
.AddNodes msoSegmentCurve, msoEditingAuto, (ctr - known_side), (ctr
+ unknown_side(rad, known_side))
Debug.Print "k " & known_side & " u " & unknown_side(rad,
known_side)
Next known_side
.ConvertToShape.Select
End With
End Sub
Function unknown_side(known_side, rad) As Single
'remember Pythagorus?
unknown_side = Sqr(Abs((rad * rad) - (known_side * known_side)))
End Function
I don't know if that helps...
Doug
"Zone" wrote in message
oups.com...
Sorry to harp on this. I need an explanation of the AddNodes
msoSegmentCurve arguments. Or, is there a site that goes into this?
Thanks!
|