Message 1 of 7
Ak2 VBA help for Extrusion

Not applicable
02-21-2001
05:39 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi:
Can some one look in to following code and tell me why am I getting error?
All am trying to do is add a polyline, select the last added item in
selection set, make a region out of selection set (This is where I get
error) and finally extrude the region.
The objective is to extrude LWPolyline. If you have any other suggestions
to accomplish the same, please let me know. Thanks in advance.
Sub aaaa()
Dim plineObj As AcadPolyline
Dim points(0 To 14) As Double
Dim ssetObj As AcadSelectionSet
Dim ssetcoll As AcadSelectionSets
Dim region_a(0 To 1) As AcadRegion
Dim solid1 As Acad3DSolid
points(0) = 0: points(1) = 0: points(2) = 0
points(3) = 0: points(4) = 1: points(5) = 0
points(6) = 1: points(7) = 1: points(8) = 0
points(9) = 1: points(10) = 0: points(11) = 0
points(12) = 0: points(13) = 0: points(14) = 0
Set plineObj = ThisDrawing.ModelSpace.AddPolyline(points)
Set ssetcoll = ThisDrawing.SelectionSets
Name1 = "m1"
' this will have to change everytime you rerun during debugging
Set ssetObj = ssetcoll.Add(Name1)
ssetObj.Select acSelectionSetLast
region_a(0) = ssetObj.Item("0")
Set solid1 = ThisDrawing.ModelSpace.AddExtrudedSolid(region_a(0), 100,
0)
ssetObj.Delete
End Sub
Can some one look in to following code and tell me why am I getting error?
All am trying to do is add a polyline, select the last added item in
selection set, make a region out of selection set (This is where I get
error) and finally extrude the region.
The objective is to extrude LWPolyline. If you have any other suggestions
to accomplish the same, please let me know. Thanks in advance.
Sub aaaa()
Dim plineObj As AcadPolyline
Dim points(0 To 14) As Double
Dim ssetObj As AcadSelectionSet
Dim ssetcoll As AcadSelectionSets
Dim region_a(0 To 1) As AcadRegion
Dim solid1 As Acad3DSolid
points(0) = 0: points(1) = 0: points(2) = 0
points(3) = 0: points(4) = 1: points(5) = 0
points(6) = 1: points(7) = 1: points(8) = 0
points(9) = 1: points(10) = 0: points(11) = 0
points(12) = 0: points(13) = 0: points(14) = 0
Set plineObj = ThisDrawing.ModelSpace.AddPolyline(points)
Set ssetcoll = ThisDrawing.SelectionSets
Name1 = "m1"
' this will have to change everytime you rerun during debugging
Set ssetObj = ssetcoll.Add(Name1)
ssetObj.Select acSelectionSetLast
region_a(0) = ssetObj.Item("0")
Set solid1 = ThisDrawing.ModelSpace.AddExtrudedSolid(region_a(0), 100,
0)
ssetObj.Delete
End Sub