Assign surface body to layer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a rule that assigns lines of surfaces to the phantom layer. It looks like it actually changes any curves that are not solid geometry.
We've been using it for several years and it works great except we've just discovered it produces an error on save if there is a section view.
I believe it has something to do with the sketch for the section. There is nothing in the code to handle the entity.
When the rule is ran explicitly nothing happens to the curves in the section view.
However, the rule is set to run before save and produces the error. Still the curves are not changed.
This is the error on save:
How could an exception be added to address the section sketch?
I'd welcome any improvements to fix the issue or future proof.
Here is the existing code:
Dim doc As DrawingDocument doc = ThisDoc.Document Dim oDC As DrawingCurve Dim oDCS As DrawingCurveSegment For Each oDC In doc.Sheets(1).DrawingViews(1).DrawingCurves For Each oDCS In oDC.Segments If Not oDCS.Parent.ModelGeometry.Parent.IsSolid Then oDCS.Layer = doc.StylesManager.Layers.Item(9) End If Next Next
Inventor Pro 2023
Vault Pro 2023