用VB在cad中画直线怎么实现,我程序都编出来了,点击绘图按钮启动CAD后在CAD中没直线出来。。求原因 100
调用CAD的程序我已经知道,画直线的程序是'定义起点和终点DimptSt(0To2)AsDoubleDimptEn(0To2)AsDoubleptSt(0)=100ptS...
调用CAD的程序我已经知道,画直线的程序是'定义起点和终点
Dim ptSt(0 To 2) As Double
Dim ptEn(0 To 2) As Double
ptSt(0) = 100
ptSt(1) = 100
ptSt(2) = 0
ptEn(0) = 150
ptEn(1) = 100
ptEn(2) =0,
反正就是最后出不了图,,,急急急。。求大神解答。。高分 展开
Dim ptSt(0 To 2) As Double
Dim ptEn(0 To 2) As Double
ptSt(0) = 100
ptSt(1) = 100
ptSt(2) = 0
ptEn(0) = 150
ptEn(1) = 100
ptEn(2) =0,
反正就是最后出不了图,,,急急急。。求大神解答。。高分 展开
2个回答
展开全部
On Error Resume Next
Set ACADApp = GetObject(, "AutoCAD.Application")
If Err Then
Err.Clear
Set ACADApp = GetObject(, "AutoCAD.Application")
If Err Then
MsgBox Err.Description
Exit Sub
End If
End If
Set ACADApp = GetObject(, "AutoCAD.Application")
Set ThisDrawing = ACADApp.ActiveDocument
Dim Pline As AcadLine
Dim ptSt(0 To 2) As Double
Dim ptEn(0 To 2) As Double
ptSt(0) = 100
ptSt(1) = 100
ptSt(2) = 0
ptEn(0) = 150
ptEn(1) = 100
ptEn(2) = 0
Set Pline = ThisDrawing.ModelSpace.AddLine(ptSt, ptEn)
Set ACADApp = GetObject(, "AutoCAD.Application")
If Err Then
Err.Clear
Set ACADApp = GetObject(, "AutoCAD.Application")
If Err Then
MsgBox Err.Description
Exit Sub
End If
End If
Set ACADApp = GetObject(, "AutoCAD.Application")
Set ThisDrawing = ACADApp.ActiveDocument
Dim Pline As AcadLine
Dim ptSt(0 To 2) As Double
Dim ptEn(0 To 2) As Double
ptSt(0) = 100
ptSt(1) = 100
ptSt(2) = 0
ptEn(0) = 150
ptEn(1) = 100
ptEn(2) = 0
Set Pline = ThisDrawing.ModelSpace.AddLine(ptSt, ptEn)
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询