iLogic Hiding Part Sketches in a drawing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello All,
Need some help from the Inventor community. I have a drawing with a part in a drawing view (not a part in an assembly) that I need to hide a few different sketches. I have code for hiding sketches in a part that is in an assembly in a drawing view but being that I am extremely new to programming I cannot for the life of me figure out how to adjust it for a part only scenario. I have searched to interwebs to see if anyone else has posted about this but everything that I have found involves working with sketches in a part in an assembly in a drawing view. Could someone please help me with this. I'm sure it's an easy thing to do for someone who knows programming. Here is the code that I have been using for my part in assembly in drawing view sketch hiding. TIA
Dim oDoc As DrawingDocument oDoc = ThisApplication.ActiveDocument Dim oActiveSheet As Sheet oActiveSheet = oDoc.ActiveSheet Dim oDrawingView As DrawingView oDrawingView = oActiveSheet.DrawingViews(1) Dim oRefDoc As AssemblyDocument oRefDoc = oDrawingView.ReferencedDocumentDescriptor.ReferencedDocument Dim oAssDef As AssemblyComponentDefinition oAssDef = oRefDoc.ComponentDefinition Dim oOcc As ComponentOccurrence oOcc = oAssDef.Occurrences(1) Dim oPart As PartDocument oPart = oOcc.Definition.Document Dim oDef As PartComponentDefinition oDef = oPart.ComponentDefinition Dim oSketch As PlanarSketch For Each oSketch In oDef.Sketches Dim oSketchProxy As PlanarSketchProxy oOcc.CreateGeometryProxy(oSketch, oSketchProxy) If oSketch.Name = BackHoleSketch Then oDrawingView.SetVisibility(oSketchProxy, False) End If If oSketch.Name = BackHoleSketch1 Then oDrawingView.SetVisibility(oSketchProxy, True) End If Next