Jozi68 Posted August 19, 2009 Share Posted August 19, 2009 Does anyone know how to return the nr of vertices for a qleader? I need some VB code please. Quote Link to comment Share on other sites More sharing options...
SEANT Posted August 19, 2009 Share Posted August 19, 2009 I’m assuming you mean VB.NET, in which case the number of vertices is directly available as a property of the Leader. Quote Link to comment Share on other sites More sharing options...
Jozi68 Posted August 19, 2009 Author Share Posted August 19, 2009 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. Quote Link to comment Share on other sites More sharing options...
SEANT Posted August 19, 2009 Share Posted August 19, 2009 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 Quote Link to comment Share on other sites More sharing options...
Jozi68 Posted August 19, 2009 Author Share Posted August 19, 2009 Thank you so much SEANT, it is working like a dream. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.