Home > Software engineering >  VB, how to put the ends of the arc and the ends of the two straight lines to connect?
VB, how to put the ends of the arc and the ends of the two straight lines to connect?

Time:11-08

Private Sub Command1_Click ()
Dim PN1 (0 To 2) As a Double
Dim PN2 (0 To 2) As a Double
Dim PN3 (0 To 2) As a Double
Dim PN4 (0 To 2) As a Double
Dim li1 As AcadLine
Dim ArcObj As AcadArc
Dim the startPoint (0 To 2) As a Double
PN1 (0)=10: PN1 (1)=10: PN1 (2)=0 'starting point coordinates
PN2 (0)=30: PN2 (1)=10: PN2 (2)=0 'end coordinates
PN3 (0)=10: PN3 (1)=15: PN3 (2)=0 'starting point coordinates
PN4 (0)=30: PN4 (1)=15: PN4 (2)=0
Draws lines'
The Set li1=acadapp. ActiveDocument. ModelSpace. AddLine (PN1, PN2)
The Set li2=acadapp. ActiveDocument. ModelSpace. AddLine (PN3, PN4)
Set ArcObj=acadapp. ActiveDocument. ModelSpace. AddArc (the startPoint, 15, 20, 30)
ZoomAll
End Sub

CodePudding user response:

First of all, you say the problem is not how VB inside connection curve and straight line, but how to use VBA operating CAD line drawing in CAD,
Second, you have already call drew two lines in the code, the starting and ending coordinates have to be able to use painting lines, then you should not is the end of the line is one of the endpoints of arc?

Get things to look, to understand the code, run to see the effect, think about why would draw the two lines, why is painted,
"Think about will not send it
  •  Tags:  
  • VBA