brianxian 发表于 2010-7-28 22:52:00

求修改,vba旋转生成实体

<p>Public Sub createsping()<br/>&nbsp; On Error Resume Next<br/>&nbsp; Dim pt(0 To 2) As Double<br/>&nbsp; pt(0) = 0: pt(1) = 0: pt(2) = 0<br/>&nbsp; If Err Then<br/>&nbsp;&nbsp;&nbsp; Err.Clear<br/>&nbsp;&nbsp;&nbsp; Exit Sub<br/>&nbsp;End If<br/>&nbsp; Dim cir1 As AcadCircle<br/>&nbsp; Dim cir2 As AcadCircle<br/>&nbsp; Dim pnts As Variant<br/>&nbsp; Set cir1 = ThisDrawing.ModelSpace.AddCircle(pt, 5)<br/>&nbsp; Dim p(0 To 2) As Double<br/>&nbsp; Dim t(0 To 2) As Double<br/>&nbsp;&nbsp; p(0) = 10: p(1) = 0: p(2) = 0<br/>&nbsp;&nbsp; t(0) = 10: t(1) = 10: t(2) = 0<br/>&nbsp; </p>
<p>&nbsp; <br/>&nbsp; cc = ThisDrawing.ModelSpace.AddRegion(cir1)<br/>&nbsp; <br/>&nbsp; <br/>&nbsp; Dim re As Acad3DSolid<br/>&nbsp; Set re = ThisDrawing.ModelSpace.AddRevolvedSolid(cc, p, t, 6.28)</p>
<p>End Sub</p>
<p>始终不能生成实体~~~~~</p>
页: [1]
查看完整版本: 求修改,vba旋转生成实体