"I assume you mean how to define a command that you can enter at the autocad
command line to run a vba program?" not really
Actualy I have a userform with
Length: textbox(L)
With: textbox(W)
I want to draw a rectangle with dim (LxW)
I did found some code like this:
Private Sub CommandButton2_Click()
Dim lijn As AcadLine
Dim startpoint(0 To 2) As Double
Dim endpoint(0 To 2) As Double
startpoint(0) = x1: endpoint(0) = x2
startpoint(1) = y1: endpoint(1) = y2
startpoint(2) = 0: endpoint(2) = 0
Set lijn = ThisDrawing.ModelSpace.AddLine(startpoint, endpoint)
lijn.Update
' Drawing
Dim Le As Variant
Dim Wi As Variant
Le = L.Value
Wi = W.Value
now I dont know how to draw those 4 lines to get my rectangle, yes I want 4 lines, this is just a part of my programmation...
Someone knows how to do it,
I did try:
RetVal = Object.AddLine(startpoint(0,0), endpoint(L, 0, 0))
and
Call lijn(startpoint(0, 0,), endpoint(L, 0, 0))
but none of them works...
Message was edited by: sakamink