How to remove bend line for high bend radius value

How to remove bend line for high bend radius value

f_yilmaz_82
Contributor Contributor
605 Views
4 Replies
Message 1 of 5

How to remove bend line for high bend radius value

f_yilmaz_82
Contributor
Contributor

Hello,

I am using an ilogic rule to automatically generate bend lines in sheet metal drawing.

But if the bend radius value is greater than 10mm I don't want it to be the bend line and the bend note

Are there any ILogic rules for this?

0 Likes
Accepted solutions (1)
606 Views
4 Replies
Replies (4)
Message 2 of 5

Michael.Navara
Advisor
Advisor
Accepted solution

Bend lines are created automatically and can't be deleted, but can be hidden.

This sample doesn't cover work with bend notes, because it depends on the reason (why and when they are created).

 

But you can start your research from this short snippet. This code hides all bend lines in drawing view which belongs to bends with inner radius greater then 10 mm (1 cm)

'This assumes the drawing is active and the first view on first sheet
'contains flat pattern
Dim drawing As DrawingDocument = ThisDoc.Document
Dim flatPatternView As DrawingView = drawing.Sheets(1).DrawingViews(1)
Dim part As PartDocument = flatPatternView.ReferencedDocumentDescriptor.ReferencedDocument
Dim sheetMetalDef As SheetMetalComponentDefinition = part.ComponentDefinition
Dim flatPattern As FlatPattern = sheetMetalDef.FlatPattern


For Each flatBendResult As FlatBendResult In flatPattern.FlatBendResults
    Dim edge As Edge = flatBendResult.Edge
    Dim innerRadius As Double = flatBendResult.InnerRadius
    If innerRadius > 1 Then '[cm]
        Dim edgeDrawingCurves As DrawingCurvesEnumerator = flatPatternView.DrawingCurves(edge)
        For Each edgeDrawingCurve As DrawingCurve In edgeDrawingCurves
            For Each segment As DrawingCurveSegment In edgeDrawingCurve.Segments
                'TODO: Do something useful with drawing curve segment which belongs to bend grater then 1 [cm]
                segment.Visible = False
            Next
        Next
    End If
Next

 

Message 3 of 5

f_yilmaz_82
Contributor
Contributor

Thanks so much for help @Michael.Navara 

The rule is working pretty good. 

But i also need to delete bend note if the bend radius value greater than 10mm. 

I tried to do that but it's not working.

0 Likes
Message 4 of 5

Michael.Navara
Advisor
Advisor

As you wrote in the first question. You create BendNote by iLogic. When the line/bend doesn't match the criteria, don't create the BendNote

0 Likes
Message 5 of 5

f_yilmaz_82
Contributor
Contributor
Dim oDoc As DrawingDocument
Dim oSheet As Sheet
Dim oView As DrawingView
Dim oCurve As DrawingCurve
Dim oBendNote As BendNote

oDoc = ThisApplication.ActiveDocument
oSheet = oDoc.ActiveSheet

For Each oView In oSheet.DrawingViews
 For Each oCurve In oView.DrawingCurves
  If oCurve.EdgeType = Inventor.DrawingEdgeTypeEnum.kBendDownEdge _
  Or oCurve.EdgeType = Inventor.DrawingEdgeTypeEnum.kBendUpEdge Then
	' Create the bend note
	oBendNote = oSheet.DrawingNotes.BendNotes.Add(oCurve)
  End If
 Next 'oCurve
Next 'oView

 

I am using this rule to create bend note. 

Is it possible not to create the note if the bend radius value greater than 10mm.  

How can i do that

0 Likes