Home AutoCad VB Extrude 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

Extrude Polyline PDF Print E-mail
User Rating: / 2
PoorBest 
Tutorials

Before creating a solid 3d object we have to start of with creating a 2d closed polyline, circle, square etc. From here we can start the extrude command and create the 3d object.

Show/Hidden vbnet code

View source
Sub CreateExtrusionObjects()
 
 
 
	'****************************************
 
	'*** Code from VisibleVisual.com ********
 
	'****************************************
 
 
 
	Dim Points(0 To 11) As Double
 
	Dim Pline As AcadLWPolyline
 
	Dim aEntity(0) As AcadEntity
 
 
 
	'1.Create a 2d closed object. This could be anything as long as its a closed figure.
 
	Points(0) = 0: Points(1) = 0
 
	Points(2) = 0: Points(3) = 100
 
	Points(4) = 50: Points(5) = 150
 
	Points(6) = 100: Points(7) = 100
 
	Points(8) = 100: Points(9) = 0
 
	Points(10) = 0: Points(11) = 0
 
 
 
	Set Pline = ThisDrawing.ModelSpace.AddLightWeightPolyline(Points())
 
	Set aEntity(0) = Pline
 
 
 
	'2.Create a region from the polylines
 
	Dim regionObj As Variant
 
	regionObj = ThisDrawing.ModelSpace.AddRegion(aEntity)
 
 
 
	'Extrusion Details
 
	Dim height As Double
 
	Dim taperAngle As Double
 
	height = 100
 
	taperAngle = 0
 
 
 
	'3.Create the extrusion
 
	Dim solidObj As Acad3DSolid
 
	Set solidObj = ThisDrawing.ModelSpace.AddExtrudedSolid(regionObj(0), height, taperAngle)
 
 
 
	ZoomAll
 
	End Sub

 
The result is shown below:
 
extrudeobject
 

 

Comments   

 
0 #1 Guest 2011-08-23 21:26
hallo, very nice, how do I reverse this action, I want to write a script where it will reconize whitch objects has been extrude, or revolve and give me the result as in your script
Quote
 

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