展开全部
Sub addrectangle()
kuan = ThisDrawing.Utility.GetReal("矩形宽")
gao = ThisDrawing.Utility.GetReal("矩形高")
pt = ThisDrawing.Utility.GetPoint(, "左上角坐标")
drawbox pt, kuan, gao
End Sub
Function drawbox(pt, width, height) As AcadLWPolyline
Dim boxp(0 To 7) As Double
boxp(0) = pt(0): boxp(1) = pt(1) '左上角
boxp(2) = pt(0): boxp(3) = pt(1) - height '左下角
boxp(4) = pt(0) + width: boxp(5) = pt(1) - height '右下角
boxp(6) = pt(0) + width: boxp(7) = pt(1) '右上角
Set drawbox = ThisDrawing.ModelSpace.AddLightWeightPolyline(boxp)
drawbox.Closed = True
End Function
kuan = ThisDrawing.Utility.GetReal("矩形宽")
gao = ThisDrawing.Utility.GetReal("矩形高")
pt = ThisDrawing.Utility.GetPoint(, "左上角坐标")
drawbox pt, kuan, gao
End Sub
Function drawbox(pt, width, height) As AcadLWPolyline
Dim boxp(0 To 7) As Double
boxp(0) = pt(0): boxp(1) = pt(1) '左上角
boxp(2) = pt(0): boxp(3) = pt(1) - height '左下角
boxp(4) = pt(0) + width: boxp(5) = pt(1) - height '右下角
boxp(6) = pt(0) + width: boxp(7) = pt(1) '右上角
Set drawbox = ThisDrawing.ModelSpace.AddLightWeightPolyline(boxp)
drawbox.Closed = True
End Function
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |