- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, I'm looking for a solution to catch exceptions occurring during feature creation.
Example:My script creates a sketch in a part and uses that to create a cut extrusion. The data for the geometry comes from an external spreadsheet. When the data is correct, the sketch lies on a face of the part body and extrudes into the part, so everything is fine. But when the data is bad, it may happen that the sketch lies outside the part faces, so a cut is impossible and the extrudefeature fails.
... bad example because it doesn't cause the behavior I wanted to show. New example, which really shows the error:
The script tries to create a simple fillet (Fillets.AddSimple) on an edge with a much too big radius, which makes the fillet creation geometrically impossible. This causes an exception and stops the rule execution.
Try
Dim oFillet As FilletFeature = oCompDef.Features.FilletFeatures.AddSimple(oEdgeCollection, 50)
Catch
End Try
Even if I put the creation of the feature (extrude, fillet etc) into a try-catch-block, it still causes the script to crash with an exception. What I want to achieve is that I can output an error message and the script continues without creating the feature, or maybe creates a feature with a healtproblem but doesn't crash.
Is that possible? If it is: how?
Solved! Go to Solution.