请问如何用CAD VBA先画条直线,然后把这条直线放到已创建的组里去。 20
2个回答
展开全部
Option Explicit
Sub Test()
Dim Line As AutoCAD.AcadLine
Set Line = Me.CreateLine(0, 0, 0, 300, 400, 500)
Debug.Print "长度:" & Line.Length
End Sub
Public Function CreateLine(xStartPoint As Double, yStartPoint As Double, zStartPoint As Double, _
xEndPoint As Double, yEndPoint As Double, zEndPoint As Double) As AutoCAD.AcadLine
Dim Line As AutoCAD.AcadLine, sP(0 To 2) As Double, eP(0 To 2) As Double
sP(0) = xStartPoint: sP(1) = yStartPoint: sP(2) = zStartPoint
eP(0) = xEndPoint: eP(1) = yEndPoint: eP(2) = zEndPoint
Set CreateLine = Application.ActiveDocument.ModelSpace.AddLine(sP, eP)
End Function
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询