Public acadDoc As Object
Dim As mLine Object
As a Boolean Function boot_CAD ()
On the Error Resume Next
The Set acadApp=GetObject (, "AutoCAD. Application")
If Err Then
Err. Clear
The Set acadApp=CreateObject (" AutoCAD. Application ")
If Err Then
MsgBox "you don't have to install AutoCAD, or installation error!" , vbOKOnly + vbInformation, "simple CAD plotting system
"Boot_CAD=False
BtOK=False
The Exit Function
End the If
End the If
The Set acadDoc=acadApp. ActiveDocument
AcadApp. Visible=True
Boot_CAD=True
End the Function
Private Sub Command1_Click ()
Dim mStPt (2) As a Double, mEdPt (2) As a Double
Dim As mLine Object
If boot_CAD=True Then
MStPt (0)=1
MStPt (1)=2
MStPt (2)=0
MEdPt (0)=2
MEdPt (1)=3
MEdPt (2)=0
The Set mLine=acadDoc. ModelSpace. AddLine (mStPt mEdPt)
MLine. Color=1
MLine. Update
ZoomAll
End the If
End Sub
CodePudding user response:
CodePudding user response:
The development of the CAD have system.addin interface,CodePudding user response:
Please refer to the VBA for AutoCAD online help,