如何用VB编程序绘cad图,比如利用vb编程在VB里画一个源,一条直线。谢谢
1个回答
展开全部
先在 工程-引用 里面增加autocad类型库然后写以下代码
Private Sub Command1_Click()
Dim p(2) As Double
Dim acad As AcadApplication
Dim mspace As AcadDocument
Set acad = CreateObject("autocad.application.16")
acad.Visible = True
Set mspace = acad.Documents.Add
For i = 1.5 To 99.5
p(0) = i: p(1) = i: p(2) = 0
mspace.ModelSpace.AddCircle p, Sqr(2) / 2
Next i
End Sub
Private Sub Command1_Click()
Dim p(2) As Double
Dim acad As AcadApplication
Dim mspace As AcadDocument
Set acad = CreateObject("autocad.application.16")
acad.Visible = True
Set mspace = acad.Documents.Add
For i = 1.5 To 99.5
p(0) = i: p(1) = i: p(2) = 0
mspace.ModelSpace.AddCircle p, Sqr(2) / 2
Next i
End Sub
追问
朋友 能告诉我QQ么 我有问题请教 十分感谢。 在线等
追答
346366404
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询