Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Hide bend extent lines in flatpattern in drawing

1 REPLY 1
Reply
Message 1 of 2
LarsBJepsen
370 Views, 1 Reply

Hide bend extent lines in flatpattern in drawing

Hi,

 

I'm writing a code that will hide the bendextents of non selected bendlines in flat pattern view in a drawing. I have found this snipplet, but here I have to select the bend extent lines instead of the bend line. Any suggestions?

Dim selectedCurve1 As DrawingCurveSegment = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingCurveSegmentFilter, "Select first Bendextet line")
Dim selectedCurve2 As DrawingCurveSegment = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingCurveSegmentFilter, "Select second Bendextent line")

Dim drawingview As DrawingView = selectedCurve1.Parent.Parent
For Each curve As DrawingCurve In drawingview.DrawingCurves
    If (curve.EdgeType = DrawingEdgeTypeEnum.kBendExtentEdge) Then
        If ((curve.Equals(selectedCurve1.Parent) = False) And (curve.Equals(selectedCurve2.Parent) = False)) Then
            For Each segment As DrawingCurveSegment In curve.Segments
                segment.Visible = False
            Next
        End If
    End If
Next
1 REPLY 1
Message 2 of 2
StuartRoodt
in reply to: LarsBJepsen

Hi Lars,

 

I've had the same issue and came across your post. I've found that the below works for ALL bend extents, so will require tweaking to exclude views that you have selected. Perhaps you can add the selected views to an array list ('Keep'), then direct the oView in line 7 to the inverted list.

 

Dim oDrawingDoc As DrawingDocument
	oDrawingDoc = ThisApplication.ActiveDocument
Dim oSheet As Sheet

For Each oSheet In oDrawingDoc.Sheets
    Dim oView As DrawingView
		For Each oView In oSheet.DrawingViews
		 
'TURN BEND EXTENTS OFF
		If oView.DisplayBendExtents = True Then oView.DisplayBendExtents = False	
		Next
Next
			

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report