Message 1 of 4
Regions - Adding elements

Not applicable
06-06-2006
06:58 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a series of lines and arcs that create what I believe to be a closed loop. When I run the following code:
Dim Elem As AcadEntity, regionObj As Variant, oLine As AcadLine, solidObj As Acad3DSolid
For Each Elem In ThisDrawing.ModelSpace
'Find the path of the extrusion
If Elem.Layer = "Path" Then
If Elem.ObjectName <> "AcDbLine" Then
Set oLine = Elem
End If
'Find the elements of the extursion
Else
If Elem.ObjectName = "AcDbArc" Or Elem.ObjectName <> "AcDbLine" Then
regionObj = ThisDrawing.ModelSpace.AddRegion(Elem)
End If
End If
Next
Set solidObj = ThisDrawing.ModelSpace.AddExtrudedSolidAlongPath(regionObj(0), oLine)
ZoomAll
I get the error "Invalid Object Array" on the line where I'm trying to add the elements to the region.
Dim Elem As AcadEntity, regionObj As Variant, oLine As AcadLine, solidObj As Acad3DSolid
For Each Elem In ThisDrawing.ModelSpace
'Find the path of the extrusion
If Elem.Layer = "Path" Then
If Elem.ObjectName <> "AcDbLine" Then
Set oLine = Elem
End If
'Find the elements of the extursion
Else
If Elem.ObjectName = "AcDbArc" Or Elem.ObjectName <> "AcDbLine" Then
regionObj = ThisDrawing.ModelSpace.AddRegion(Elem)
End If
End If
Next
Set solidObj = ThisDrawing.ModelSpace.AddExtrudedSolidAlongPath(regionObj(0), oLine)
ZoomAll
I get the error "Invalid Object Array" on the line where I'm trying to add the elements to the region.