- 积分
- 1044
- 明经币
- 个
- 注册时间
- 2003-4-1
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
高手看看,以下程序为什么有错误?我很迷惑!
'创建六边形 Dim objPline As AcadLWPolyline 'acadpolyline Dim ptCen(0 To 2) As Double ptCen(0) = 0: ptCen(1) = 0: ptCen(2) = 0
myCAD.Visible = True
Dim NumPoly As Integer '多边形的边数 Dim RadiPoly As Double '多边形的半径
NumPoly = InputBox("多边形的数量:", "参数输入", 6) RadiPoly = InputBox("多边形的半径:", "参数输入", 30)
''''''''%%%%%%%%%%%%%%%%%%%%%%% Dim objLine As AcadLine Dim SP(0 To 2) As Double Dim EP(0 To 2) As Double
Dim rad_Seg As Double
Dim myCurves() As AcadEntity
ReDim myCurves(0 To NumPoly - 1) As AcadEntity
rad_Seg = 2 * PI / NumPoly
ptCenX = 0: ptCenY = 0: ptCenZ = 0
For I = 0 To NumPoly - 1
If I <> NumPoly - 1 Then SP(0) = ptCenX + RadiPoly * Cos(I * rad_Seg) SP(1) = ptCenY + RadiPoly * Sin(I * rad_Seg) SP(2) = ptCenZ + 0 EP(0) = ptCenX + RadiPoly * Cos((I + 1) * rad_Seg) EP(1) = ptCenY + RadiPoly * Sin((I + 1) * rad_Seg) EP(2) = ptCenZ + 0
Set myCurves(I) = myMOS.AddLine(SP, EP) Else SP(0) = ptCenX + RadiPoly * Cos(I * rad_Seg) SP(1) = ptCenY + RadiPoly * Sin(I * rad_Seg) SP(2) = ptCenZ + 0 EP(0) = ptCenX + RadiPoly EP(1) = ptCenY EP(2) = ptCenZ + 0
Set myCurves(I) = myMOS.AddLine(SP, EP) End If Debug.Print I & " X:" & SP(0) & " Y:" & SP(1) & " Z:" & SP(2) Debug.Print I & " X:" & EP(0) & " Y:" & EP(1) & " Z:" & EP(2)
Next I
''''''''%%%%%%%%%%%%%%%%%%%%%%%
'创建面域
'以上部分都是成功的!!
Dim objRegion As Variant Set objRegion = myMOS.AddRegion(myCurves) '本句为甚么总是提示 :实时错误13
'类型不匹配
'高手看看,很郁闷呀
|
|