Jump to content

VB to return nr of vertices of leader


Jozi68

Recommended Posts

No, this is an old VB6 application unfortunately. I see there is a GetVertexCount method, but I have no idea how to implement that (or if it is even relevant).

I have a selectionset of leaders, but get an error if I refer to a vertext that does not exist, so I need to know how many there are.

Link to comment
Share on other sites

Ah, yes. In that case the COORDINATES property can provide the vert count, i.e.,

 

 

Sub LeaderPtCount()
Dim varPkPt As Variant
Dim ent As AcadEntity
Dim entlead As AcadLeader
Dim varCoords As Variant
Dim intNumOfVerts As Integer


ThisDrawing.Utility.GetEntity ent, varPkPt, "Select a Leader: "

If TypeOf ent Is AcadLeader Then
Set entlead = ent
varCoords = entlead.Coordinates
intNumOfVerts = (UBound(varCoords) + 1) / 3
MsgBox "The selected leader has " & intNumOfVerts & " vertices."
End If

End Sub

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...