API Created Section View: Sketch Not Deleted on Manual Remove
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I'm programmatically creating sectional views on a drawing sheet using the Inventor API (specifically Sheet.DrawingViews.AddSectionView). As required by the API, I first create a DrawingSketch on the sheet on the FRONT VIEW and draw the section line within it before calling the AddSectionView method, passing the sketch as an argument.
The views are created successfully. However, I've observed a difference in behavior when these views are manually deleted through the Inventor user interface compared to manually created section views:
- When a sectional view is created manually in Inventor and then manually deleted, the drawing sketch used for the section line is also automatically deleted.
- When a sectional view is created using the API and then manually deleted, the SectionDrawingView object is removed, but the DrawingSketch and the section line geometry within it remain on the sheet.
This difference is causing orphaned sketches in my drawings when users manually delete views that were originally created by my API code.
My question is:
- Why does manual deletion not trigger the cleanup of the sketch when the sectional view was created via the API? Is there a difference in the type of link or dependency established between the sketch and the view by the manual command compared to the AddSectionView API method?
- Is there any way, using the Inventor API during the creation process (AddSectionView or other methods), to establish the same kind of link or dependency that causes the sketch to be automatically deleted when the user manually deletes the section view?
I am aware that I can explicitly delete the DrawingSketch using the API after deleting the SectionDrawingView programmatically. However, I am specifically interested in whether it's possible to replicate the automatic manual cleanup behavior seen with manually created views, or to understand the technical reason why this difference exists.
Tested on Inventor 2022
Any insights or guidance on this behavior would be greatly appreciated.
Thank you!
Befor delete
After deleting the setional views