Home AutoCad VB Create Polyline
20 | 05 | 2012
This site has been updated and renewed. You have followed an old link.

Click here to go to the new site

http://www.visiblevisual.com/jupgrade

Create Polyline PDF Print E-mail
User Rating: / 4
PoorBest 
Tutorials

 We are going to start by creating a little piece of code to create a simple line object. Open the editor with ALT & F11 and create the following text in the thisdrawing object.
You could see this code as a alternative LINE command. You follow the same steps as when you do this manually. You first provide the start coordinates then the end coordinates and finally you order VBA to place the line between those two tutorials.

Show/Hidden vbnet code

View source
Sub Createpolyline()
 
 
 
 
 
	'****************************************
 
	'*** Code from VisibleVisual.com ********
 
	'****************************************
 
 
 
	Dim Points(0 To 17) As Double
 
	'Define the polyline Coordinates XY, XY, XY .....
 
	Points(0) = 0: Points(1) = 100
 
	Points(2) = 0: Points(3) = 0
 
	Points(4) = 100: Points(5) = 0
 
	Points(6) = 0: Points(7) = 100
 
	Points(8) = 50: Points(9) = 150
 
	Points(10) = 100: Points(11) = 100
 
	Points(12) = 100: Points(13) = 0
 
	Points(14) = 100: Points(15) = 100
 
 
 
	ThisDrawing.ModelSpace.AddLightWeightPolyline (Points())
 
 
 
	ZoomAll
 
 
 
	End Sub

 

The code above creates the same drawing as show below.


After creating a polyline its possible to continue the code and to add extrusions or subtractions to it. See the tutorial list for more tutorials on this

Attachments:
FileDescriptionFile sizeDownloads
Download this file (Pline.dvb)Pline.dvbCreate Polyline10 Kb431
 

Add comment


Security code
Refresh

This site has been updated and renewed. You have followed an old link.

Click here to go to the new site

http://www.visiblevisual.com/jupgrade