本人小白一个请教大虾呀,VB调用CAD画图,比如矩形是啥命令,为什么线条可以Dim line1 as acadline,矩形?
矩形为啥Dimrec1asacadrectang,CAD直接画图命令不就是Rectang吗是上面补充的命令无法编译。。。...
矩形为啥Dim rec1 as acadrectang,CAD直接画图命令不就是Rectang吗
是上面补充的命令无法编译。。。 展开
是上面补充的命令无法编译。。。 展开
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)
用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)
追问
上面sendcommand语句有错呀,麻烦看一下,谢谢
追答
object.SendCommand "Rectang " & X1 & "," & Y1 & " " & X2 & "," & Y2 & " "
嗯是有问题,应该是这样的.你再试试
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询