Convert objects to revcloud

Convert objects to revcloud

Anonymous
Not applicable
1,151 Views
3 Replies
Message 1 of 4

Convert objects to revcloud

Anonymous
Not applicable

Hi,

I'm trying to convert a closed 2D polyline into a revcloud (like using the command Revcloud > Object).
But it seems there's no VBA command to draw a revcloud.
So I had the idea to add bulges between each vertex, but with this solution my cloud's arcs can be very small...

 

Has anyone tried to make a macro doing this?
Any other solution to submit?

 

Thanks,

 

PS: Here is my code :

 

If Entity.Layer = "RevCloud" Then
   If Entity.EntityType = acPolyline Then
      NumberVertices = 0
                    
      vCoord = Entity.Coordinates
      For Each Dcoord In vCoord
         NumberVertices = NumberVertices + 1
      Next
                    
      NumberVertices = NumberVertices / 3
                    
      If Entity.Type <> acSimplePoly Then
         Entity.Type = acSimplePoly
      End If
                        
      For nIndex = 0 To NumberVertices - 1
         Entity.SetBulge nIndex, -1
      Next
   End If
End If

 

0 Likes
1,152 Views
3 Replies
Replies (3)
Message 2 of 4

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

>> but with this solution my cloud's arcs can be very small..

maybe I don't understand the question, but with your algorythm the arcs are as small(as large) as the distances between the vertices are. So the decission would be to remove some vertices if the distance between the vertices is to small (or to add some vertices to get smaller arcs).

 

BTW: your code does not round up the last two segments. Smiley Happy

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes
Message 3 of 4

Anonymous
Not applicable

Yes, I though about this solution, but I didn't find the command to do that... Smiley Indifferent

Is there any way to remove vertices easily? Because I will need to check the spacing between two vertices...

 

>> BTW: your code does not round up the last two segments.

 

Really? I didn't saw that problem...

0 Likes
Message 4 of 4

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

it's just an array-handling. You have the property ".Coordinates" for the POLYLINE, that's an array of doubles (be carefull about the difference between LW-Polyline and Polyline (2D)). Remove items from this array (means remove vertizes from poly) and assign the new array back to the POLYLINE.

This example shows how to eliminate the last vertex from a LWPOLYLINE:

   Dim tPoly As AcadLWPolyline
   Dim tPnt As Variant
   Dim tCoords As Variant
   
   Call ThisDrawing.Utility.GetEntity(tPoly, tPnt)
   tCoords = tPoly.Coordinates
   ReDim Preserve tCoords(UBound(tCoords) - 2)
   tPoly.Coordinates = tCoords

 

HTH, - alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes