AnsweredAssumed Answered

Macro to traverse imported model's faces for closed loops

Question asked by Charles Clark on Dec 17, 2015
Latest reply on Dec 17, 2015 by Charles Clark

Going through an old library of parts where I want to verify the dimensions (and/or existence) of some features.


These are STEP and IGS files, so everything is just an "imported" body.


What I'm looking for are small rectangular and cross shaped "notches" of varying depth and dimensions on multiple faces. (basically Philips and regular head screwdriver marks)


Of course, I don't expect someone to write this for me (though I won't turn it down either!), but some thoughts or guidance on the best approach and API extensions to use for the various steps would be appreciated!


How I'm envisioning this working:


1) Create and process a new SW part(s) from specified file (or folder)


2) Open each file and do the following:


3) Identify and traverse all faces to identify closed loops on them (<- This is my biggest challenge.)


4) If an identified closed loop's edge lengths are all within a specified range (or just less than something), append the following values to a text file (or return them somehow):


  - specific part and face containing the closed loop (and possibly the loop's location on face)

  - Total number of edges in the closed loop

  - list of all closed loop edge lengths


5) (bonus) automatic annotation identifying all the part's criteria-matched closed loops




Using SW 2016