ilogic to count the number of points in a part model sketch

ilogic to count the number of points in a part model sketch

nowell.colsenXK53F
Enthusiast Enthusiast
132 Views
2 Replies
Message 1 of 3

ilogic to count the number of points in a part model sketch

nowell.colsenXK53F
Enthusiast
Enthusiast

I'm trying to count the number of points in a sketch that has a custom name. the points are imported from excel to a sketch that is used for hole placement. I have a code that will give a count from sketch driven pattern. that works great for smaller parts (or less holes), but when the part and number of holes gets too large the sketch driven pattern crashes. So, I want to count the point in my sketch instead. looking for a little help. I have tried a few things with no success.

0 Likes
133 Views
2 Replies
Replies (2)
Message 2 of 3

Curtis_Waguespack
Consultant
Consultant

Hi @nowell.colsenXK53F , this example will count all of the points in the named sketch of the active document.

 

Hope that helps, Curtis

 

Dim oDoc As PartDocument = ThisDoc.Document
Dim oSketch As PlanarSketch = oDoc.ComponentDefinition.Sketches.Item("My Sketch")
Dim oPoints As SketchPoints = oSketch.SketchPoints

MsgBox(oPoints.Count)

 

EESignature

0 Likes
Message 3 of 3

nowell.colsenXK53F
Enthusiast
Enthusiast
THAT WORKED. THANK YOU