Hi I'm new to catia VBA I want to write code which automatically extracts sharp edges and display the total length of sharp edges. Can anyone please help me.
1 Answers
Foreword: I assume you're dealing with Bodies( not surfaces) which are not too much complex. Option 1: It should be possible by exploiting the Search methods of Part.Selection object. It is possible to search within the topology I.e. Not only within the explicit part's features you see in the tree, but also in the topology supporting them: edges, faces.... Try to play with the manual search command checking the "include topology" option and see if you can get to a query string that does the job. Then it will be very easy to automate it and the measure of the edges will be an easy task. I'll try to improve my answer later if I can get to a complete solution.
Option 2: extract the complete outer surface of your body. Then you could extract a random face of it and propagate in tangency. The boundary of the resulting surface will be sharp. Measure the boundary or a disassemble of it, then continue on the remainder of the surface until nothing remains. This will not guarantee that you'll always identify all the sharp edges in case some of them do not form closed contours. To pick a random face in automation use Search within topology in a similar way described in option 1.
If you need detailed steps for the individual tasks I've described, please refer to the vast number of other answers/ tutorials available on the Web Cheers

- 81
- 5