|
发表于 2005-5-28 18:20:00
|
显示全部楼层
Dim arcObj As AcadArc '''''''''''''''''''''''''''''''''''''''''弧
Dim centerPoint(0 To 2) As Double
Dim radius As Double
Dim startAngleInDegree As Double 'Sqr(nj ^ 2 - (b / 2) ^ 2) + ybjl
Dim endAngleInDegree As Double
Dim thisdrawing As AcadDocument
Set thisdrawing = acadapp.ActiveDocument
'Dim ppp As Double
ppp = (b / 2) / Sqr(nj ^ 2 - (b / 2) ^ 2)
qqq = Atn(ppp)
' Define the circle
centerPoint(0) = ybjl#: centerPoint(1) = zxxsp#: centerPoint(2) = 0#
radius = nj#
startAngleInDegree = ppp
endAngleInDegree = -qqq
' Convert the angles in degrees to angles in radians
Dim startAngleInRadian As Double
Dim endAngleInRadian As Double
startAngleInRadian = startAngleInDegree * 3.141592 / 180#
endAngleInRadian = endAngleInDegree * 3.141592 / 180#
' Create the arc object in model space
Set arcObj = thisdrawing.ModelSpace.AddArc(centerPoint, radius, startAngleInRadian, endAngleInRadian)
ZoomAll
完整程序如上,其中我要定义这俩个角才可以画出弧,假如我直接给角附值,那可以轻松画出弧.但是假如我给他附一个变量,怎么就画不出来啊...???
startAngleInDegree = ppp
endAngleInDegree = -qqq
ppp可以,但是经过反正切Atn(ppp)得到qqq之后,就画不出来了,是不是不能用反正切函数啊???
ppp = (b / 2) / Sqr(nj ^ 2 - (b / 2) ^ 2)
qqq = Atn(ppp) |
|