Help - Deleting Sketch Views

Help - Deleting Sketch Views

mslosar
Advisor Advisor
298 Views
1 Reply
Message 1 of 2

Help - Deleting Sketch Views

mslosar
Advisor
Advisor

I have a routine in .net that loops through all view in an idw and deletes different things so as to create 'clean drawings' for internal use when required.

 

One part of that routine deletes sketchviews (exempting breakout view sketches) people may add on top of views for whatever reason. Code is below.

 

 Dim oDV As DrawingView
            Dim oSV As DrawingSketch

            For Each oDV In oSht.DrawingViews
                If oDV.BreakOutOperations.Count < 1 Then
                    For Each oSV In oDV.Sketches
                        oSV.Delete()
                    Next
                End If
            Next

The problem is section views - or more aptly, the section lines themselves. Apparently .sketches find the sketch under the section lines and deletes that. You can then no longer move the section arrows, and most importantly if you decide to delete a section view, it crashes Inventor.

 

Is there a way of skipping sketches used in sections? Or will sketches have to be left on regardless and then manually deleted? 

0 Likes
299 Views
1 Reply
Reply (1)
Message 2 of 2

MechMachineMan
Advisor
Advisor
Ugh. Just came across something similar in making a different program.

The sketches used for section lines and the connection to section views and the section lines themselves is all very invisible to any want to be programmer. In order to accomplish any type of skipping of section lines, you will have to come up with a very creative work-around.

--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes