本人小白一个请教大虾呀,VB调用CAD画图,比如矩形是啥命令,为什么线条可以Dim line1 as acadline,矩形?

2025-01-05 11:05:56
推荐回答(1个)
回答1:

cad 程序里没有acadrectang这个实体名称
用sendcommand的方法
object.SendCommand "Rectang " & x1 "," & y1 " " & x1 "," & y1 " "

或者先定义四个点用多线段的方法画,s是四个坐标点
dim s(0 to 7) as double
Dim lwp As AcadLWPolyline

set lwp=object.AddLightWeightPolyline(s)