Would you like to use AutoCAD commands from
Visual Basic or VBA?
Use the SendCommand method on the document object.
This example sends a command to the AutoCAD command line of a particular drawing
for evaluation. We will create a Circle in the active drawing and will zoom to
display the entire circle
'CODING STARTS HERE
Sub Example_SendCommand()
ThisDrawing.SendCommand "_Circle"
& vbCr & "2,2,0" & vbCr & "4" & vbCr
ThisDrawing.SendCommand "_zoom" & vbCr & "a" &
vbCr
ThisDrawing.Regen acAllViewports
MsgBox "A circle command has been sent to the command line of the current
drawing."
End Sub
'CODING ENDS HERE
|