how to automaticle add bend notes to a specific drawing view

how to automaticle add bend notes to a specific drawing view

JonnyPot
Advocate Advocate
960 Views
4 Replies
Message 1 of 5

how to automaticle add bend notes to a specific drawing view

JonnyPot
Advocate
Advocate

Hello.

I would like to a specific view (A) with all the bend notes automatically made as indicated in the image (like in SolidWorks), and another view with all the bend lines turned off (B)

 

Thankyou.

 

A and B 1.png

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

bhavik4244
Collaborator
Collaborator

@JonnyPot 

 

To add the Bend Notes:

 

Dim oDoc As DrawingDocument = ThisApplication.ActiveDocument
Dim oSheet As Sheet = oDoc.ActiveSheet
Dim oView As DrawingView
Dim oCurve As DrawingCurve
Dim oBendNote As BendNote

oView  = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingViewFilter, "Select a View to give the bend notes.")

		For Each oCurve In oView.DrawingCurves

			If (oCurve.EdgeType = Inventor.DrawingEdgeTypeEnum.kBendDownEdge _
				Or oCurve.EdgeType = Inventor.DrawingEdgeTypeEnum.kBendUpEdge) Then

	oBendNote = oSheet.DrawingNotes.BendNotes.Add(oCurve)

				If oBendNote.Text.Contains("DOWN") Then
					Dim oText = Replace(oBendNote.Text, "DOWN", "DOWN")
					oBendNote.HideValue = True
					oBendNote.Text = oText
				End If
				If oBendNote.Text.Contains("UP") Then
					Dim oText = Replace(oBendNote.Text, "UP", "UP")
					oBendNote.HideValue = True
					oBendNote.Text = oText
				End If
			End If
			
			
		Next 

 

 

To Hide the Bend Lines:

 

Dim oDoc As DrawingDocument = ThisApplication.ActiveDocument
Dim oSheet As Sheet = oDoc.ActiveSheet
Dim oView As DrawingView
Dim oCurve As DrawingCurve
Dim oBendNote As BendNote

oView  = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingViewFilter, "Select a View to hide the bend lines.")
		
For Each oCurve In oView.DrawingCurves

			If (oCurve.EdgeType = Inventor.DrawingEdgeTypeEnum.kBendDownEdge _
				Or oCurve.EdgeType = Inventor.DrawingEdgeTypeEnum.kBendUpEdge) Then

            For Each segment As DrawingCurveSegment In oCurve.Segments
                segment.Visible = False
            Next
    End If
Next

 

 

 


Bhavik Suthar
Message 3 of 5

JonnyPot
Advocate
Advocate

is it  possible to have them defined to a particular view, it would be very inconvenient to me if i have to select the view every time.

 

Thank You.

0 Likes
Message 4 of 5

bhavik4244
Collaborator
Collaborator
Accepted solution

Try this one:

 

1. For Bend note:

Dim oDoc As DrawingDocument = ThisApplication.ActiveDocument
Dim oSheet As Sheet = oDoc.ActiveSheet
Dim oView As DrawingView
Dim oCurve As DrawingCurve
Dim oBendNote As BendNote
Dim oViews = oSheet.DrawingViews
'oView  = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingViewFilter, "Select a View to give the bend notes.")

For Each oView In oViews
		For Each oCurve In oView.DrawingCurves

			If (oCurve.EdgeType = Inventor.DrawingEdgeTypeEnum.kBendDownEdge _
				Or oCurve.EdgeType = Inventor.DrawingEdgeTypeEnum.kBendUpEdge) Then

	oBendNote = oSheet.DrawingNotes.BendNotes.Add(oCurve)

				If oBendNote.Text.Contains("DOWN") Then
					Dim oText = Replace(oBendNote.Text, "DOWN", "DOWN")
					oBendNote.HideValue = True
					oBendNote.Text = oText
				End If
				If oBendNote.Text.Contains("UP") Then
					Dim oText = Replace(oBendNote.Text, "UP", "UP")
					oBendNote.HideValue = True
					oBendNote.Text = oText
				End If
			End If
			
			
		Next 
	Next

 

 

2. To Hide the Lines:

 

Dim oDoc As DrawingDocument = ThisApplication.ActiveDocument
Dim oSheet As Sheet = oDoc.ActiveSheet
Dim oView As DrawingView
Dim oCurve As DrawingCurve
Dim oBendNote As BendNote

Dim oViews = oSheet.DrawingViews

	'oView  = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingViewFilter, "Select a View to hide the bend lines.")

For Each oView In oViews
	
For Each oCurve In oView.DrawingCurves

			If (oCurve.EdgeType = Inventor.DrawingEdgeTypeEnum.kBendDownEdge _
				Or oCurve.EdgeType = Inventor.DrawingEdgeTypeEnum.kBendUpEdge) Then

            For Each segment As DrawingCurveSegment In oCurve.Segments
                segment.Visible = False
            Next
    End If
Next
Next


Bhavik Suthar
Message 5 of 5

r_pruellage
Contributor
Contributor

Hello, thanks for your code. It works very well.

Is it possible to delete the Radius and the Value of it? And delete the ° of Degrees?

0 Likes