- UID
- 796562
- 积分
- 64
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2020-2-19
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
本帖最后由 木瓜_dP7jf 于 2020-2-21 08:57 编辑
求高手指点
运行后只是一个二维图,不知哪有问题
On Error Resume Next
acadApp = GetObject(, "AutoCAD.Application")
If Err.Number Then
Err.Clear()
acadApp = CreateObject("AutoCAD.Application")
If Err.Number Then
MsgBox(Err.Description)
Exit Sub
End If
End If
acadApp.Visible = True
acadApp.Documents.Add()
acadDoc = acadApp.ActiveDocument
acadApp.Visible = True '设|¨¨置?界?面?可¨|视o¨®
acadApp.WindowState = AutoCAD.AcWindowState.acMax '设|¨¨置?界?面?最á?大䨮化¡¥
AppActivate(acadApp.Caption) '显?示o?AutoCAD界?面?
acadApp.ActiveDocument.Layers.Item(0).color = AutoCAD.AcColor.acRed
Dim NewDirection(0 To 2) As Double
NewDirection(0) = 1 : NewDirection(1) = 0.5 : NewDirection(2) = 0.5
acadApp.ActiveDocument.ActiveViewport.Direction = NewDirection
acadApp.ActiveDocument.ActiveViewport = acadApp.ActiveDocument.ActiveViewport
Dim c1(10) As AcadEntity
Dim cpt(0 To 2) As Double
Dim cl1(0 To 2) As Double
Dim cl2(0 To 2) As Double
Dim radius As Double
Dim starp As Double
Dim endp As Double
radius = 20
starp = 0
endp = pi
cpt(0) = 85 : cpt(1) = 60 : cpt(2) = 0
cl1(0) = 105 : cl1(1) = 60 : cl1(2) = 0
cl2(0) = 65 : cl2(1) = 60 : cl2(2) = 0
c1(0) = acadApp.ActiveDocument.ModelSpace.AddArc(cpt, radius, starp, endp)
c1(1) = acadApp.ActiveDocument.ModelSpace.AddLine(cl1, cl2)
c1(0).color = AutoCAD.AcColor.acYellow
c1(1).color = AutoCAD.AcColor.acYellow
Dim skiving1 As Object
skiving1 = acadApp.ActiveDocument.ModelSpace.AddRegion(c1)
Dim taper As Double
Dim height As Double
Dim solidskiv As Object
taper = 0
height = 100
solidskiv = acadApp.ActiveDocument.ModelSpace.AddExtrudedSolid(skiving1(0), height, taper)
|
|