<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: VBA revolve problem, help... in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/vba-revolve-problem-help/m-p/11591402#M2065</link>
    <description>&lt;LI-CODE lang="general"&gt;Public Sub TestAddRevolvedSolid()
Dim objShape As AcadLWPolyline
Dim varPick As Variant
Dim objEnt As AcadEntity
Dim varPnt1 As Variant
Dim dblOrigin(2) As Double
Dim dblAngle As Double
Dim objEnts() As AcadEntity
Dim varRegions As Variant
Dim varItem As Variant
Dim StartPoint As Variant
Dim EndPoint As Variant

'' draw the shape and get rotation from user
With ThisDrawing.Utility
'' pick a shape
On Error Resume Next
.GetEntity objShape, varPick, "pick a polyline shape"
If Err Then
MsgBox "You did not pick the correct type of shape"
Exit Sub
End If
On Error GoTo Done
objShape.Closed = True
'' add pline to region input array
ReDim objEnts(0)
Set objEnts(0) = objShape
'' get the axis points
.InitializeUserInput 1
varPnt1 = .GetPoint(, vbLf &amp;amp; "Pick an origin of revolution: ")
.InitializeUserInput 1
StartPoint = ThisDrawing.Utility.GetPoint(, "")
EndPoint = ThisDrawing.Utility.GetPoint(, "")
varVec = VectorFrom2pt(StartPoint, EndPoint)
'' get the angle to revolve
.InitializeUserInput 1
dblAngle = .GetAngle(, vbLf &amp;amp; "Angle to revolve: ")
End With
'' make the region, then revolve it into a solid
With ThisDrawing.ModelSpace
'' make region from closed pline
varRegions = .AddRegion(objEnts)
'' revolve solid about axis
Set objEnt = .AddRevolvedSolid(varRegions(0), varPnt1, varVec, _
dblAngle)
objEnt.color = acRed
End With
Done:
If Err Then MsgBox Err.Description
'' delete the temporary geometry
For Each varItem In objEnts: varItem.Delete: Next
If Not IsEmpty(varRegions) Then

For Each varItem In varRegions: varItem.Delete: Next
End If
ThisDrawing.SendCommand "_shade" &amp;amp; vbCr
End Sub

Public Function VectorFrom2pt(pt1 As Variant, pt2 As Variant) As Variant
Dim vec(0 To 2) As Double
vec(0) = pt1(0) - pt2(0)
vec(1) = pt1(1) - pt2(1)
vec(2) = pt1(2) - pt2(2)
VectorFrom2pt = vec
End Function&lt;/LI-CODE&gt;</description>
    <pubDate>Fri, 02 Dec 2022 14:52:49 GMT</pubDate>
    <dc:creator>suparhigh12345</dc:creator>
    <dc:date>2022-12-02T14:52:49Z</dc:date>
    <item>
      <title>VBA revolve problem, help...</title>
      <link>https://forums.autodesk.com/t5/vba-forum/vba-revolve-problem-help/m-p/11576500#M2058</link>
      <description>&lt;P&gt;Hi, I have one problem, with this code below, there is no way to revolve polyline around red centerline if polyline is set at specific angle. Example (&lt;SPAN&gt;Drawing1test.dwg)&lt;/SPAN&gt;:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="testUntitled.jpg" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1144154iAF3DD1433C994636/image-size/large?v=v2&amp;amp;px=999" role="button" title="testUntitled.jpg" alt="testUntitled.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Error: "General modeling failure&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="visual-basic"&gt;Public Sub TestAddRevolvedSolid()
Dim objShape As AcadLWPolyline
Dim varPick As Variant
Dim objEnt As AcadEntity
Dim varPnt1 As Variant
Dim dblOrigin(2) As Double
Dim varVec As Variant
Dim dblAngle As Double
Dim objEnts() As AcadEntity
Dim varRegions As Variant
Dim varItem As Variant

'' draw the shape and get rotation from user
With ThisDrawing.Utility
'' pick a shape
On Error Resume Next
.GetEntity objShape, varPick, "pick a polyline shape"
If Err Then
MsgBox "You did not pick the correct type of shape"
Exit Sub
End If
On Error GoTo Done
objShape.Closed = True
'' add pline to region input array
ReDim objEnts(0)
Set objEnts(0) = objShape
'' get the axis points
.InitializeUserInput 1
varPnt1 = .GetPoint(, vbLf &amp;amp; "Pick an origin of revolution: ")
.InitializeUserInput 1
varVec = .GetPoint(dblOrigin, vbLf &amp;amp; _
"Indicate the axis of revolution: ")
'' get the angle to revolve
.InitializeUserInput 1
dblAngle = .GetAngle(, vbLf &amp;amp; "Angle to revolve: ")
End With
'' make the region, then revolve it into a solid
With ThisDrawing.ModelSpace
'' make region from closed pline
varRegions = .AddRegion(objEnts)
'' revolve solid about axis
Set objEnt = .AddRevolvedSolid(varRegions(0), varPnt1, varVec, _
dblAngle)
objEnt.color = acRed
End With
Done:
If Err Then MsgBox Err.Description
'' delete the temporary geometry
For Each varItem In objEnts: varItem.Delete: Next
If Not IsEmpty(varRegions) Then

For Each varItem In varRegions: varItem.Delete: Next
End If
ThisDrawing.SendCommand "_shade" &amp;amp; vbCr
End Sub

&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;any Help? Thank you&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Moderator edit: put code into code window using &amp;lt;/&amp;gt; button.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2022 16:31:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/vba-revolve-problem-help/m-p/11576500#M2058</guid>
      <dc:creator>suparhigh12345</dc:creator>
      <dc:date>2022-11-29T16:31:20Z</dc:date>
    </item>
    <item>
      <title>Re: VBA revolve problem, help...</title>
      <link>https://forums.autodesk.com/t5/vba-forum/vba-revolve-problem-help/m-p/11576507#M2059</link>
      <description>&lt;P&gt;DWG example (poly):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;P.s It doesnt even matter if poly is a 3d poly line or &lt;SPAN&gt;AcadLWPolyline&lt;/SPAN&gt;. There is still error... any help?&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Thu, 24 Nov 2022 21:27:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/vba-revolve-problem-help/m-p/11576507#M2059</guid>
      <dc:creator>suparhigh12345</dc:creator>
      <dc:date>2022-11-24T21:27:16Z</dc:date>
    </item>
    <item>
      <title>Re: VBA revolve problem, help...</title>
      <link>https://forums.autodesk.com/t5/vba-forum/vba-revolve-problem-help/m-p/11588876#M2060</link>
      <description>&lt;P&gt;You are setting varVec to a point. While the vector is a 3 element array of doubles, it is not the endpoint of the axis. You could select the start point and end point of your axis and then use the following function.&lt;/P&gt;
&lt;LI-CODE lang="visual-basic"&gt;varVec = VectorFrom2pt(startpoint, endpoint)

Public Function VectorFrom2pt(pt1 As Variant, pt2 As Variant) As Variant
    Dim vec(0 To 2) As Double
    vec(0) = pt1(0) - pt2(0)
    vec(1) = pt1(1) - pt2(1)
    vec(2) = pt1(2) - pt2(2)
    VectorFrom2pt = vec
End Function
&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 30 Nov 2022 21:32:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/vba-revolve-problem-help/m-p/11588876#M2060</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2022-11-30T21:32:45Z</dc:date>
    </item>
    <item>
      <title>Re: VBA revolve problem, help...</title>
      <link>https://forums.autodesk.com/t5/vba-forum/vba-revolve-problem-help/m-p/11591332#M2061</link>
      <description>&lt;P&gt;Thank you. Can u make a &lt;STRONG&gt;full &lt;/STRONG&gt;code sample cuz I am still getting the same error.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2022 17:57:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/vba-revolve-problem-help/m-p/11591332#M2061</guid>
      <dc:creator>suparhigh12345</dc:creator>
      <dc:date>2022-12-01T17:57:28Z</dc:date>
    </item>
    <item>
      <title>Re: VBA revolve problem, help...</title>
      <link>https://forums.autodesk.com/t5/vba-forum/vba-revolve-problem-help/m-p/11591337#M2062</link>
      <description>&lt;P&gt;If you changed your code, show the revised code.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2022 18:00:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/vba-revolve-problem-help/m-p/11591337#M2062</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2022-12-01T18:00:30Z</dc:date>
    </item>
    <item>
      <title>Re: VBA revolve problem, help...</title>
      <link>https://forums.autodesk.com/t5/vba-forum/vba-revolve-problem-help/m-p/11591352#M2063</link>
      <description>&lt;P&gt;I'm probably doing it wrong&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Public Sub TestAddRevolvedSolid()&lt;BR /&gt;Dim objShape As AcadLWPolyline&lt;BR /&gt;Dim varPick As Variant&lt;BR /&gt;Dim objEnt As AcadEntity&lt;BR /&gt;Dim varPnt1 As Variant&lt;BR /&gt;Dim dblOrigin(2) As Double&lt;BR /&gt;Dim dblAngle As Double&lt;BR /&gt;Dim objEnts() As AcadEntity&lt;BR /&gt;Dim varRegions As Variant&lt;BR /&gt;Dim varItem As Variant&lt;/P&gt;&lt;P&gt;'' draw the shape and get rotation from user&lt;BR /&gt;With ThisDrawing.Utility&lt;BR /&gt;'' pick a shape&lt;BR /&gt;On Error Resume Next&lt;BR /&gt;.GetEntity objShape, varPick, "pick a polyline shape"&lt;BR /&gt;If Err Then&lt;BR /&gt;MsgBox "You did not pick the correct type of shape"&lt;BR /&gt;Exit Sub&lt;BR /&gt;End If&lt;BR /&gt;On Error GoTo Done&lt;BR /&gt;objShape.Closed = True&lt;BR /&gt;'' add pline to region input array&lt;BR /&gt;ReDim objEnts(0)&lt;BR /&gt;Set objEnts(0) = objShape&lt;BR /&gt;'' get the axis points&lt;BR /&gt;.InitializeUserInput 1&lt;BR /&gt;varPnt1 = .GetPoint(, vbLf &amp;amp; "Pick an origin of revolution: ")&lt;BR /&gt;.InitializeUserInput 1&lt;BR /&gt;varVec = VectorFrom2pt(StartPoint, EndPoint)&lt;BR /&gt;'' get the angle to revolve&lt;BR /&gt;.InitializeUserInput 1&lt;BR /&gt;dblAngle = .GetAngle(, vbLf &amp;amp; "Angle to revolve: ")&lt;BR /&gt;End With&lt;BR /&gt;'' make the region, then revolve it into a solid&lt;BR /&gt;With ThisDrawing.ModelSpace&lt;BR /&gt;'' make region from closed pline&lt;BR /&gt;varRegions = .AddRegion(objEnts)&lt;BR /&gt;'' revolve solid about axis&lt;BR /&gt;Set objEnt = .AddRevolvedSolid(varRegions(0), varPnt1, varVec, _&lt;BR /&gt;dblAngle)&lt;BR /&gt;objEnt.color = acRed&lt;BR /&gt;End With&lt;BR /&gt;Done:&lt;BR /&gt;If Err Then MsgBox Err.Description&lt;BR /&gt;'' delete the temporary geometry&lt;BR /&gt;For Each varItem In objEnts: varItem.Delete: Next&lt;BR /&gt;If Not IsEmpty(varRegions) Then&lt;/P&gt;&lt;P&gt;For Each varItem In varRegions: varItem.Delete: Next&lt;BR /&gt;End If&lt;BR /&gt;ThisDrawing.SendCommand "_shade" &amp;amp; vbCr&lt;BR /&gt;End Sub&lt;/P&gt;&lt;P&gt;Public Function VectorFrom2pt(pt1 As Variant, pt2 As Variant) As Variant&lt;BR /&gt;Dim vec(0 To 2) As Double&lt;BR /&gt;vec(0) = pt1(0) - pt2(0)&lt;BR /&gt;vec(1) = pt1(1) - pt2(1)&lt;BR /&gt;vec(2) = pt1(2) - pt2(2)&lt;BR /&gt;VectorFrom2pt = vec&lt;BR /&gt;End Function&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2022 18:09:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/vba-revolve-problem-help/m-p/11591352#M2063</guid>
      <dc:creator>suparhigh12345</dc:creator>
      <dc:date>2022-12-01T18:09:43Z</dc:date>
    </item>
    <item>
      <title>Re: VBA revolve problem, help...</title>
      <link>https://forums.autodesk.com/t5/vba-forum/vba-revolve-problem-help/m-p/11591369#M2064</link>
      <description>&lt;P&gt;It's hard to read when you don't put your code in a code window. Not only do you lose the color formatting, but all the indents are not preserved. Can you edit your post and choose Visual Basic as the code format?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, you typed "varVec = VectorFrom2pt(StartPoint, EndPoint)". You don't have StartPoint and EndPoint in your sub. Those are just variable I used so you could get the idea.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2022 18:15:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/vba-revolve-problem-help/m-p/11591369#M2064</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2022-12-01T18:15:54Z</dc:date>
    </item>
    <item>
      <title>Re: VBA revolve problem, help...</title>
      <link>https://forums.autodesk.com/t5/vba-forum/vba-revolve-problem-help/m-p/11591402#M2065</link>
      <description>&lt;LI-CODE lang="general"&gt;Public Sub TestAddRevolvedSolid()
Dim objShape As AcadLWPolyline
Dim varPick As Variant
Dim objEnt As AcadEntity
Dim varPnt1 As Variant
Dim dblOrigin(2) As Double
Dim dblAngle As Double
Dim objEnts() As AcadEntity
Dim varRegions As Variant
Dim varItem As Variant
Dim StartPoint As Variant
Dim EndPoint As Variant

'' draw the shape and get rotation from user
With ThisDrawing.Utility
'' pick a shape
On Error Resume Next
.GetEntity objShape, varPick, "pick a polyline shape"
If Err Then
MsgBox "You did not pick the correct type of shape"
Exit Sub
End If
On Error GoTo Done
objShape.Closed = True
'' add pline to region input array
ReDim objEnts(0)
Set objEnts(0) = objShape
'' get the axis points
.InitializeUserInput 1
varPnt1 = .GetPoint(, vbLf &amp;amp; "Pick an origin of revolution: ")
.InitializeUserInput 1
StartPoint = ThisDrawing.Utility.GetPoint(, "")
EndPoint = ThisDrawing.Utility.GetPoint(, "")
varVec = VectorFrom2pt(StartPoint, EndPoint)
'' get the angle to revolve
.InitializeUserInput 1
dblAngle = .GetAngle(, vbLf &amp;amp; "Angle to revolve: ")
End With
'' make the region, then revolve it into a solid
With ThisDrawing.ModelSpace
'' make region from closed pline
varRegions = .AddRegion(objEnts)
'' revolve solid about axis
Set objEnt = .AddRevolvedSolid(varRegions(0), varPnt1, varVec, _
dblAngle)
objEnt.color = acRed
End With
Done:
If Err Then MsgBox Err.Description
'' delete the temporary geometry
For Each varItem In objEnts: varItem.Delete: Next
If Not IsEmpty(varRegions) Then

For Each varItem In varRegions: varItem.Delete: Next
End If
ThisDrawing.SendCommand "_shade" &amp;amp; vbCr
End Sub

Public Function VectorFrom2pt(pt1 As Variant, pt2 As Variant) As Variant
Dim vec(0 To 2) As Double
vec(0) = pt1(0) - pt2(0)
vec(1) = pt1(1) - pt2(1)
vec(2) = pt1(2) - pt2(2)
VectorFrom2pt = vec
End Function&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 02 Dec 2022 14:52:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/vba-revolve-problem-help/m-p/11591402#M2065</guid>
      <dc:creator>suparhigh12345</dc:creator>
      <dc:date>2022-12-02T14:52:49Z</dc:date>
    </item>
    <item>
      <title>Re: VBA revolve problem, help...</title>
      <link>https://forums.autodesk.com/t5/vba-forum/vba-revolve-problem-help/m-p/11591416#M2066</link>
      <description>&lt;P&gt;I'm not sure how you are picking the points. You prompt for an axis origin, then a StartPoint and EndPoint. You don't need to prompt for an origin if you prompt for a start point. The rotation origin is the start point of the axis and the vector is returned by the function I gave you. sorry I don't have more time right now to actually test this myself.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2022 18:33:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/vba-revolve-problem-help/m-p/11591416#M2066</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2022-12-01T18:33:21Z</dc:date>
    </item>
    <item>
      <title>Re: VBA revolve problem, help...</title>
      <link>https://forums.autodesk.com/t5/vba-forum/vba-revolve-problem-help/m-p/11591481#M2067</link>
      <description>&lt;P&gt;1.pick: midpoint of red centerline&lt;/P&gt;&lt;P&gt;2.pick: leftpoint of&amp;nbsp;red centerline&lt;/P&gt;&lt;P&gt;3.pick: rightpoint of&amp;nbsp;red centerline&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="suparhigh12345_0-1669921065560.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1147075iB1274E34DCC360A6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="suparhigh12345_0-1669921065560.png" alt="suparhigh12345_0-1669921065560.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can u check 44. line?&lt;/P&gt;&lt;P&gt;varPnt1&amp;nbsp;is asked for?....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I dont know what the problem is but there is still an error.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2022 18:57:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/vba-revolve-problem-help/m-p/11591481#M2067</guid>
      <dc:creator>suparhigh12345</dc:creator>
      <dc:date>2022-12-01T18:57:54Z</dc:date>
    </item>
    <item>
      <title>Re: VBA revolve problem, help...</title>
      <link>https://forums.autodesk.com/t5/vba-forum/vba-revolve-problem-help/m-p/11615201#M2068</link>
      <description>&lt;P&gt;The drawing you posted has the polyline created with 5 line segments. When you create a rectangle polyline, you should only use 3 line segments and then use the Close option for the 4th segment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, your code doesn't account for the region and axis to not be coplanar withe the current ucs. I started from scratch to create some modular and readable code. There's not a lot of error checking like the REVOLVE command does, but it works when the entities are in the world ucs. For other ucs's you will have to add code to do coordinate transformations. I would probably use the region to create a temporary ucs and transform the axis coords to that ucs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="visual-basic"&gt;
Public Sub RotPoly3D()
    
    On Error GoTo Err_Control
    Dim ss As AcadSelectionSet
    ThisDrawing.Utility.Prompt "\nSelect a coplanar Polyline:&amp;gt; "
    Set ss = GetSS_ByObjFilter("line,arc")
    Dim ary() As AcadEntity
    SStoArray ss, ary
    Dim vRegions As Variant
    vRegions = ThisDrawing.ModelSpace.AddRegion(ary)
    
    Dim pt1 As Variant
    Dim pt2 As Variant
    Dim vVector As Variant
    ThisDrawing.Utility.InitializeUserInput 1
    pt1 = ThisDrawing.Utility.GetPoint(, "\nSelect start point of rotation axis:&amp;gt;")
    pt2 = ThisDrawing.Utility.GetPoint(pt1, "\nSelect end point of rotation axis:&amp;gt;")
    vVector = VectorFrom2pt(pt1, pt2)
    
    Dim oEnt As Acad3DSolid
    Set oEnt = ThisDrawing.ModelSpace.AddRevolvedSolid(vRegions(0), pt1, vVector, 2 * PI)
'    oent.Material =
    
    
Exit_Here:
    Exit Sub
Err_Control:
    Select Case Err.Number
    'Add your Case selections here
    Case Is = -2147352567
        ' Nothing was selected.
        Err.Clear
        Resume Exit_Here
    Case Else
        MsgBox Err.Number &amp;amp; ", " &amp;amp; Err.Description, , "RotPoly3D"
        Err.Clear
        Resume Exit_Here
    End Select
End Sub


Public Function VectorFrom2pt(pt1 As Variant, pt2 As Variant) As Variant
    Dim vec(0 To 2) As Double
    vec(0) = pt1(0) - pt2(0)
    vec(1) = pt1(1) - pt2(1)
    vec(2) = pt1(2) - pt2(2)
    VectorFrom2pt = vec
End Function

Public Function SStoArray(ss As AcadSelectionSet, ary() As AcadEntity)

    Dim cnt As Integer
    cnt = ss.Count() - 1
'    Dim ary() As AcadEntity
    Dim i As Integer
    ReDim ary(0)
    For i = 0 To cnt
        Set ary(i) = ss(i)
        If i &amp;lt; cnt Then ReDim Preserve ary(UBound(ary) + 1)
    Next
    SStoArray = ary
    
End Function

Public Function GetSS_ByObjFilter(filter As String) As AcadSelectionSet
    'creates an filtered ss
    Dim s2 As AcadSelectionSet      'for filtered ss
    
    Dim intFtyp(0) As Integer                       ' setup for the filter
    Dim varFval(0) As Variant
    Dim varFilter1, varFilter2 As Variant
    intFtyp(0) = 0: varFval(0) = filter           ' get only filtered entities
    varFilter1 = intFtyp: varFilter2 = varFval
    Set s2 = AddSelectionSet("ssFiltered")              ' create or get the set
    s2.Clear                                        ' clear the set
    s2.SelectOnScreen varFilter1, varFilter2        ' do it

    s2.Highlight True
    s2.Update
    Set GetSS_ByObjFilter = s2

End Function
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Dec 2022 19:24:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/vba-revolve-problem-help/m-p/11615201#M2068</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2022-12-12T19:24:17Z</dc:date>
    </item>
    <item>
      <title>Re: VBA revolve problem, help...</title>
      <link>https://forums.autodesk.com/t5/vba-forum/vba-revolve-problem-help/m-p/11623388#M2069</link>
      <description>&lt;P&gt;Hi, your code doesnt work.&lt;/P&gt;&lt;P&gt;Error: "compile error, sub function not defined"&lt;/P&gt;&lt;P&gt;?&lt;/P&gt;</description>
      <pubDate>Thu, 15 Dec 2022 19:19:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/vba-revolve-problem-help/m-p/11623388#M2069</guid>
      <dc:creator>suparhigh12345</dc:creator>
      <dc:date>2022-12-15T19:19:36Z</dc:date>
    </item>
    <item>
      <title>Re: VBA revolve problem, help...</title>
      <link>https://forums.autodesk.com/t5/vba-forum/vba-revolve-problem-help/m-p/11623937#M2070</link>
      <description>&lt;P&gt;Looks like I forgot about the AddSelectionSet function. I’ve posted it recently. Search this forum for it.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2022 00:27:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/vba-revolve-problem-help/m-p/11623937#M2070</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2022-12-16T00:27:52Z</dc:date>
    </item>
  </channel>
</rss>

