Drawing Note Generator

Drawing Note Generator

cmcconnell
Collaborator Collaborator
614 Views
1 Reply
Message 1 of 2

Drawing Note Generator

cmcconnell
Collaborator
Collaborator

In the interest of giving back to the community for all that I have taken, here is a set of rules, forms and triggers I have created to build and maintain drawing notes. Also included as part of the note selection is a tool to select the tblock for the drawing. These rules contain our note text, and some of them pull info from model properties. This could easily be changed to suit your requirements.

 

Please keep in mind that I am not a programmer and a lot of this is likely very crude - and could be written in a much more efficient way. 🙂 I have been able to make our note creation much more efficient than it was.

 

Step 1:

Creates Parameters in idw

Trigger: on open, on new

Rule (Create Note Params):

oDrawDoc = ThisApplication.ActiveDocument
'oDrawDoc = ThisDoc.Document
	Dim oDrawParams As UserParameters = oDrawDoc.Parameters.UserParameters
	
	sText1 = "-"
	sText2 = "Apply thread locker as per 0000-45-16132."
	sText3 = "Bolt Lengths are approximate and can vary due to part tolerances and/or " + vbCrLf + "     urethane compression."
	sText4 = "Mark as shown."
	sText5 = "Etch assembly no. <Part Number> in visible location."
	sText6 = "Arrange gauging plates from rear to front, largest to smallest starting at " + vbCrLf + "     position 4, then 3, 2, 1. (EX: A 2GP will use positions 4 & 3)"
	sText7 = "Plates may be removed to create configurations of 1GP, 2GP & " + vbCrLf + "     3GP. When removing plates from their locations; leave spacers in place."
	sText8 = "Machine from: <Machine From>"
	sText9 = "<Model Comments>"
	sText10 = "Dimensions provided for reference only. Part to be machined from " + vbCrLf + "     solid model data and mold will be verified by checking dimensions of " + vbCrLf + "     the molded part."
	sText11 = "Trim all excess material from finished part & check for defects."
	sText12 = "Remove all burrs & sharp edges."
	sText13 = "Urethane dept. to stamp molded part no. " + vbCrLf + "<Molded Part Number> in visible location."
	sText14 = "Electrical Engineering dept. to stamp molded part no. " + vbCrLf + "<Molded Part Number> in visible location."
	sText15 = "Mark Part / Weldment (in a visible location & when possible) with " + vbCrLf + "       last 5 digits of Part Number UNO."
	sText16 = "<Stock Number>"
	sText17 = "Verify OD and circumference before marking locations of mounts."
	'sText18 =
	'stext19 =
	
	
	' Create and populate note parameters
	' Check to see if each parameter exists
	Try
		'If yes, update values
		pNote1 = oDrawParams.Item("Note1")
			MultiValue.SetList("Note1", _
			sText1, _
			sText2, _ 
			sText3, _
			sText4, _
			sText5, _
			sText6, _
			sText7, _
			sText8, _
			sText9, _
			sText10, _
			sText11, _
			sText12, _
			sText13, _
			sText14, _
			sText15, _
			sText16, _
			sText17)
		Catch
			'If no, create and populate values
			pNote1 = oDrawParams.AddByValue("Note1" , "-", UnitsTypeEnum.kTextUnits)
			MultiValue.SetList("Note1", _
			sText1, _
			sText2, _ 
			sText3, _
			sText4, _
			sText5, _
			sText6, _
			sText7, _
			sText8, _
			sText9, _
			sText10, _
			sText11, _
			sText12, _
			sText13, _
			sText14, _
			sText15, _
			sText16, _
			sText17)
		End Try
		
	Try
		'If yes, update values
		pNote2 = oDrawParams.Item("Note2")
			MultiValue.SetList("Note2", _
			sText1, _
			sText2, _ 
			sText3, _
			sText4, _
			sText5, _
			sText6, _
			sText7, _
			sText8, _
			sText9, _
			sText10, _
			sText11, _
			sText12, _
			sText13, _
			sText14, _
			sText15, _
			sText16, _
			sText17)
		Catch
			'If no, create and populate values
			pNote2 = oDrawParams.AddByValue("Note2" , "-", UnitsTypeEnum.kTextUnits)
			MultiValue.SetList("Note2", _
			sText1, _
			sText2, _ 
			sText3, _
			sText4, _
			sText5, _
			sText6, _
			sText7, _
			sText8, _
			sText9, _
			sText10, _
			sText11, _
			sText12, _
			sText13, _
			sText14, _
			sText15, _
			sText16, _
			sText17)
		End Try
		
	Try
		'If yes, update values
		pNote3 = oDrawParams.Item("Note3")
			MultiValue.SetList("Note3", _
			sText1, _
			sText2, _ 
			sText3, _
			sText4, _
			sText5, _
			sText6, _
			sText7, _
			sText8, _
			sText9, _
			sText10, _
			sText11, _
			sText12, _
			sText13, _
			sText14, _
			sText15, _
			sText16, _
			sText17)
		Catch
			'If no, create and populate values
			pNote3 = oDrawParams.AddByValue("Note3" , "-", UnitsTypeEnum.kTextUnits)
			MultiValue.SetList("Note3", _
			sText1, _
			sText2, _ 
			sText3, _
			sText4, _
			sText5, _
			sText6, _
			sText7, _
			sText8, _
			sText9, _
			sText10, _
			sText11, _
			sText12, _
			sText13, _
			sText14, _
			sText15, _
			sText16, _
			sText17)
		End Try
		
	Try
		'If yes, update values
		pNote4 = oDrawParams.Item("Note4")
			MultiValue.SetList("Note4", _
			sText1, _
			sText2, _ 
			sText3, _
			sText4, _
			sText5, _
			sText6, _
			sText7, _
			sText8, _
			sText9, _
			sText10, _
			sText11, _
			sText12, _
			sText13, _
			sText14, _
			sText15, _
			sText16, _
			sText17)
		Catch
			'If no, create and populate values
			pNote4 = oDrawParams.AddByValue("Note4" , "-", UnitsTypeEnum.kTextUnits)
			MultiValue.SetList("Note4", _
			"-", _
			sText1, _
			sText2, _ 
			sText3, _
			sText4, _
			sText5, _
			sText6, _
			sText7, _
			sText8, _
			sText9, _
			sText10, _
			sText11, _
			sText12, _
			sText13, _
			sText14, _
			sText15, _
			sText16, _
			sText17)
		End Try
		
	Try
		'If yes, update values
		pNote5 = oDrawParams.Item("Note5")
			MultiValue.SetList("Note5", _
			sText1, _
			sText2, _ 
			sText3, _
			sText4, _
			sText5, _
			sText6, _
			sText7, _
			sText8, _
			sText9, _
			sText10, _
			sText11, _
			sText12, _
			sText13, _
			sText14, _
			sText15, _
			sText16, _
			sText17)
		Catch
			'If no, create and populate values
			pNote5 = oDrawParams.AddByValue("Note5" , "-", UnitsTypeEnum.kTextUnits)
			MultiValue.SetList("Note5", _
			sText1, _
			sText2, _ 
			sText3, _
			sText4, _
			sText5, _
			sText6, _
			sText7, _
			sText8, _
			sText9, _
			sText10, _
			sText11, _
			sText12, _
			sText13, _
			sText14, _
			sText15, _
			sText16, _
			sText17)
		End Try
		
		Try
		'If yes, update values
		pNote6 = oDrawParams.Item("Note6")
			MultiValue.SetList("Note6", _
			sText1, _
			sText2, _ 
			sText3, _
			sText4, _
			sText5, _
			sText6, _
			sText7, _
			sText8, _
			sText9, _
			sText10, _
			sText11, _
			sText12, _
			sText13, _
			sText14, _
			sText15, _
			sText16, _
			sText17)
		Catch
			'If no, create and populate values
			pNote6 = oDrawParams.AddByValue("Note6" , "-", UnitsTypeEnum.kTextUnits)
			MultiValue.SetList("Note6", _
			sText1, _
			sText2, _ 
			sText3, _
			sText4, _
			sText5, _
			sText6, _
			sText7, _
			sText8, _
			sText9, _
			sText10, _
			sText11, _
			sText12, _
			sText13, _
			sText14, _
			sText15, _
			sText16, _
			sText17)
		End Try
		
		Try
		'If yes, update values
		pNote7 = oDrawParams.Item("Note7")
			MultiValue.SetList("Note7", _
			sText1, _
			sText2, _ 
			sText3, _
			sText4, _
			sText5, _
			sText6, _
			sText7, _
			sText8, _
			sText9, _
			sText10, _
			sText11, _
			sText12, _
			sText13, _
			sText14, _
			sText15, _
			sText16, _
			sText17)
		Catch
			'If no, create and populate values
			pNote7 = oDrawParams.AddByValue("Note7" , "-", UnitsTypeEnum.kTextUnits)
			MultiValue.SetList("Note7", _
			sText1, _
			sText2, _ 
			sText3, _
			sText4, _
			sText5, _
			sText6, _
			sText7, _
			sText8, _
			sText9, _
			sText10, _
			sText11, _
			sText12, _
			sText13, _
			sText14, _
			sText15, _
			sText16, _
			sText17)
		End Try
		
		Try
		'If yes, update values
		pNote8 = oDrawParams.Item("Note8")
			MultiValue.SetList("Note8", _
			sText1, _
			sText2, _ 
			sText3, _
			sText4, _
			sText5, _
			sText6, _
			sText7, _
			sText8, _
			sText9, _
			sText10, _
			sText11, _
			sText12, _
			sText13, _
			sText14, _
			sText15, _
			sText16, _
			sText17)
		Catch
			'If no, create and populate values
			pNote8 = oDrawParams.AddByValue("Note8" , "-", UnitsTypeEnum.kTextUnits)
			MultiValue.SetList("Note8", _
			sText1, _
			sText2, _ 
			sText3, _
			sText4, _
			sText5, _
			sText6, _
			sText7, _
			sText8, _
			sText9, _
			sText10, _
			sText11, _
			sText12, _
			sText13, _
			sText14, _
			sText15, _
			sText16, _
			sText17)
		End Try

Step 2:

Creates Tblock Parameters in idw

Trigger: on open, on new

Rule (Create Tblock Params):

'Acts only on active document
Dim oDrawDoc As Document = ThisApplication.ActiveDocument
If Not oDrawDoc Is ThisDoc.Document Then Exit Sub
	
Dim oDrawParams As UserParameters = oDrawDoc.Parameters.UserParameters
	' Create and populate note parameters
	' Check to see if each parameter exists
	Try
		'If yes, update values
		pTblock1 = oDrawParams.Item("Title_Block")
			
		Catch
			'If no, create and populate values
			pTblock1 = oDrawParams.AddByValue("Title_Block" , "-", UnitsTypeEnum.kTextUnits)
			MultiValue.SetList("Title_Block", _
			"General Assembly", _
			"Machined", _
			"Machined (no appearance)", _
			"Welded Assembly", _
			"Urethane")
		End Try

Dim sTblock1 As String
sTblock1 = Parameter("Title_Block")


If oValue = "General Assembly" Then 
	' Obtain a reference to the desired sketched symbol definition.
	Dim oSketchedSymbolDef As SketchedSymbolDefinition
	oSketchedSymbolDef = oDrawDoc.SketchedSymbolDefinitions.Item("GENERAL ASSY")
	 
	Dim oSheet As Sheet = oDrawDoc.ActiveSheet
	 
	'create insertion point, coordinates - in cm !
	Dim oTG As TransientGeometry = ThisApplication.TransientGeometry
	Dim oInsertionPoint As Point2d = oTG.CreatePoint2d(17.98, 1)
	 
	' Add an instance of the sketched symbol definition to the sheet.
	' Rotate angle = 0 radians,
	' scale = 1 when adding
	' no prompt text
	Dim oSketchedSymbol As SketchedSymbol
	oSketchedSymbol = oSheet.SketchedSymbols.Add(oSketchedSymbolDef, oInsertionPoint, 0, 1, Nothing)
Else If oValue = "Machined" Then
	' Obtain a reference to the desired sketched symbol definition.
	Dim oSketchedSymbolDef As SketchedSymbolDefinition
	oSketchedSymbolDef = oDrawDoc.SketchedSymbolDefinitions.Item("MACHINED")
	 
	Dim oSheet As Sheet = oDrawDoc.ActiveSheet
	 
	'create insertion point, coordinates - in cm !
	Dim oTG As TransientGeometry = ThisApplication.TransientGeometry
	Dim oInsertionPoint As Point2d = oTG.CreatePoint2d(17.98, 1)
	 
	' Add an instance of the sketched symbol definition to the sheet.
	' Rotate angle = 0 radians,
	' scale = 1 when adding
	' no prompt text
	Dim oSketchedSymbol As SketchedSymbol
	oSketchedSymbol = oSheet.SketchedSymbols.Add(oSketchedSymbolDef, oInsertionPoint, 0, 1, Nothing)
Else If oValue = "Machined (no appearance)" Then
	' Obtain a reference to the desired sketched symbol definition.
	Dim oSketchedSymbolDef As SketchedSymbolDefinition
	oSketchedSymbolDef = oDrawDoc.SketchedSymbolDefinitions.Item("MACHINED no Appearance")
	 
	Dim oSheet As Sheet = oDrawDoc.ActiveSheet
	 
	'create insertion point, coordinates - in cm !
	Dim oTG As TransientGeometry = ThisApplication.TransientGeometry
	Dim oInsertionPoint As Point2d = oTG.CreatePoint2d(17.98, 1)
	 
	' Add an instance of the sketched symbol definition to the sheet.
	' Rotate angle = 0 radians,
	' scale = 1 when adding
	' no prompt text
	Dim oSketchedSymbol As SketchedSymbol
	oSketchedSymbol = oSheet.SketchedSymbols.Add(oSketchedSymbolDef, oInsertionPoint, 0, 1, Nothing)
Else If oValue = "Welded Assembly" Then
	' Obtain a reference to the desired sketched symbol definition.
	Dim oSketchedSymbolDef As SketchedSymbolDefinition
	oSketchedSymbolDef = oDrawDoc.SketchedSymbolDefinitions.Item("WELDED ASSY")
	 
	Dim oSheet As Sheet = oDrawDoc.ActiveSheet
	 
	'create insertion point, coordinates - in cm !
	Dim oTG As TransientGeometry = ThisApplication.TransientGeometry
	Dim oInsertionPoint As Point2d = oTG.CreatePoint2d(17.98, 1)
	 
	' Add an instance of the sketched symbol definition to the sheet.
	' Rotate angle = 0 radians,
	' scale = 1 when adding
	' no prompt text
	Dim oSketchedSymbol As SketchedSymbol
	oSketchedSymbol = oSheet.SketchedSymbols.Add(oSketchedSymbolDef, oInsertionPoint, 0, 1, Nothing)
Else If oValue = "Urethane" Then
	' Obtain a reference to the desired sketched symbol definition.
	Dim oSketchedSymbolDef As SketchedSymbolDefinition
	oSketchedSymbolDef = oDrawDoc.SketchedSymbolDefinitions.Item("URETHANE")
	 
	Dim oSheet As Sheet = oDrawDoc.ActiveSheet
	 
	'create insertion point, coordinates - in cm !
	Dim oTG As TransientGeometry = ThisApplication.TransientGeometry
	Dim oInsertionPoint As Point2d = oTG.CreatePoint2d(17.98, 1)
	 
	' Add an instance of the sketched symbol definition to the sheet.
	' Rotate angle = 0 radians,
	' scale = 1 when adding
	' no prompt text
	Dim oSketchedSymbol As SketchedSymbol
	oSketchedSymbol = oSheet.SketchedSymbols.Add(oSketchedSymbolDef, oInsertionPoint, 0, 1, Nothing)
End If

Step 3:

Runs idw startup form in idw

Trigger: on new

Rule (IDW-Startup):

'open note and tblock selection form
iLogicForm.ShowGlobal("Drawing Setup", FormMode.Modal)

'Remove existing notes
iLogicVb.RunExternalRule("Drawing Notes - Delete")

'Remove existing tblock
'iLogicVb.RunExternalRule("Title Block - Delete")

'place selected notes on idw
iLogicVb.RunExternalRule("Drawing Notes - Insert")

'place selected tblock on idw
iLogicVb.RunExternalRule("Title Block - Insert")

The IDW setup form looks like this:

corym-2018-0271.png

The user selects the tblock from the drop down and then picks which notes to show from the dropdowns. The second tab just has more notes in cases where more notes are necessary. Clicking done, inserts the tblock and the notes onto the drawing.

 

Editing the notes and tblock:

User opens the IDW setup form, makes changes and hits the Apply Updates button which runs this rule (this rule is also triggered before save to ensure the notes are up to date):

'Updates drawing notes after a change to model values

'Remove existing notes
iLogicVb.RunExternalRule("Drawing Notes - Delete")

'place selected notes on idw
iLogicVb.RunExternalRule("Drawing Notes - Insert")

Drawing Notes - Delete rule:

Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisApplication.ActiveDocument
Dim Sheet As Inventor.Sheet
Dim oSheet As Sheet
oSheet = oDrawDoc.ActiveSheet
' Set a reference to the GeneralNotes object
Dim oGeneralNotes As GeneralNotes
oGeneralNotes = oSheet.DrawingNotes.GeneralNotes

Dim oRotation As Double
	oRotation = .000001

For Each oGeneralNote In oSheet.DrawingNotes.GeneralNotes
			If oGeneralNote.Rotation = oRotation
				oGeneralNote.Delete
			End If
		Next

Drawing Notes - Insert rule:

Sub Main()

Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisApplication.ActiveDocument
Dim Sheet As Inventor.Sheet
Dim oSheet As Sheet
oSheet = oDrawDoc.ActiveSheet
' Set a reference to the GeneralNotes object
Dim oGeneralNotes As GeneralNotes
oGeneralNotes = oSheet.DrawingNotes.GeneralNotes
Dim oTG As TransientGeometry
oTG = ThisApplication.TransientGeometry
Dim oDrawParams As UserParameters = oDrawDoc.Parameters.UserParameters

'Get referenced model
Try
oModelName = IO.Path.GetFileName(ThisDrawing.ModelDocument.FullFileName)

sModelComments = iProperties.Value(oModelName, "Custom", "Model Comments")
sModelPartNumber = iProperties.Value(oModelName, "Project", "Part Number")
sModelStockNumber = iProperties.Value(oModelName, "Project", "Stock Number")
sModelMoldedPartNumber = iProperties.Value(oModelName, "Custom", "Molded Part Number")
sModelMachinedFrom = iProperties.Value(oModelName, "Custom", "Machined From")
'MessageBox.Show(sModelPartNumber, "Title")
Catch
End Try


' Create a set of notes that are numbered and aligned along the left.
    Dim dXCoord As Double
	dXCoord = 1.5 'cm
	Dim dYCoord As Double
    dYCoord = 41.5 'cm
	Dim dXCoord1 As Double
	dXCoord1 = dXCoord + 10 'cm
	Dim dYCoord1 As Double
    dYCoord1 = dYCoord - 1 'cm
    Dim dXOffset As Double
	Dim dYOffset As Double
	Dim oStyle As TextStyle
    'oStyle = oGeneralNotes.Item(1).TextStyle
    dXOffset = .225 'cm
	dYOffset = 1 'cm
	Dim oRotation As Double
	oRotation = .000001 'rad
	oSetWidth = 16 'cm
	
	ActiveSheet = ThisDrawing.Sheet("Sheet:1")


Dim sText1 As String
If Parameter("Note1") = "<Model Comments>" Then
	sText1 = sModelComments
Else If Parameter("Note1") = "<Stock Number>"
	sText1 = sModelStockNumber
Else If Parameter("Note1") = "Etch assembly no. <Part Number> in visible location."
	sText1 = "Etch assembly no. " + sModelPartNumber + " in visible location."
Else If Parameter("Note1") = "Urethane dept. to stamp molded part no. " + vbCrLf + "<Molded Part Number> in visible location."
	sText1 = "Urethane dept. to stamp molded part no. " + sModelMoldedPartNumber + " in visible location."
Else If Parameter("Note1") = "Electrical Engineering dept. to stamp molded part no. " + vbCrLf + "<Molded Part Number> in visible location."
	sText1 = "Electrical Engineering dept. to stamp molded part no. " + vbCrLf + "     " + sModelMoldedPartNumber + " in visible location."
Else If Parameter("Note1") = "Machine from: <Machine From>"
	sText1 = "Machine from: " + sModelMachinedFrom
Else
	sText1 = Parameter("Note1")
End If

Dim sText2 As String
If Parameter("Note2") = "<Model Comments>" Then
	sText2 = sModelComments
Else If Parameter("Note2") = "<Stock Number>"
	sText2 = sModelStockNumber
Else If Parameter("Note2") = "Etch assembly no. <Part Number> in visible location."
	sText2 = "Etch assembly no. " + sModelPartNumber + " in visible location."
Else If Parameter("Note2") = "Urethane dept. to stamp molded part no. " + vbCrLf + "<Molded Part Number> in visible location."
	sText2 = "Urethane dept. to stamp molded part no. " + sModelMoldedPartNumber + " in visible location."
Else If Parameter("Note2") = "Electrical Engineering dept. to stamp molded part no. " + vbCrLf + "<Molded Part Number> in visible location."
	sText2 = "Electrical Engineering dept. to stamp molded part no. " + vbCrLf + "     " + sModelMoldedPartNumber + " in visible location."
Else If Parameter("Note2") = "Machine from: <Machine From>"
	sText2 = "Machine from: " + sModelMachinedFrom
Else
	sText2 = Parameter("Note2")
End If

Dim sText3 As String
If Parameter("Note3") = "<Model Comments>" Then
	sText3 = sModelComments
Else If Parameter("Note3") = "<Stock Number>"
	sText3 = sModelStockNumber
Else If Parameter("Note3") = "Etch assembly no. <Part Number> in visible location."
	sText3 = "Etch assembly no. " + sModelPartNumber + " in visible location."
Else If Parameter("Note3") = "Urethane dept. to stamp molded part no. " + vbCrLf + "<Molded Part Number> in visible location."
	sText3 = "Urethane dept. to stamp molded part no. " + sModelMoldedPartNumber + " in visible location."
Else If Parameter("Note3") = "Electrical Engineering dept. to stamp molded part no. " + vbCrLf + "<Molded Part Number> in visible location."
	sText3 = "Electrical Engineering dept. to stamp molded part no. " + vbCrLf + "     " + sModelMoldedPartNumber + " in visible location."
Else If Parameter("Note3") = "Machine from: <Machine From>"
	sText3 = "Machine from: " + sModelMachinedFrom
Else
	sText3 = Parameter("Note3")
End If

Dim sText4 As String
If Parameter("Note4") = "<Model Comments>" Then
	sText4 = sModelComments
Else If Parameter("Note4") = "<Stock Number>"
	sText4 = sModelStockNumber
Else If Parameter("Note4") = "Etch assembly no. <Part Number> in visible location."
	sText4 = "Etch assembly no. " + sModelPartNumber + " in visible location."
Else If Parameter("Note4") = "Urethane dept. to stamp molded part no. " + vbCrLf + "<Molded Part Number> in visible location."
	sText4 = "Urethane dept. to stamp molded part no. " + sModelMoldedPartNumber + " in visible location."
Else If Parameter("Note4") = "Electrical Engineering dept. to stamp molded part no. " + vbCrLf + "<Molded Part Number> in visible location."
	sText4 = "Electrical Engineering dept. to stamp molded part no. " + vbCrLf + "     " + sModelMoldedPartNumber + " in visible location."
Else If Parameter("Note4") = "Machine from: <Machine From>"
	sText4 = "Machine from: " + sModelMachinedFrom
Else
	sText4 = Parameter("Note4")
End If

Dim sText5 As String
If Parameter("Note5") = "<Model Comments>" Then
	sText5 = sModelComments
Else If Parameter("Note5") = "<Stock Number>"
	sText5 = sModelStockNumber
Else If Parameter("Note5") = "Etch assembly no. <Part Number> in visible location."
	sText5 = "Etch assembly no. " + sModelPartNumber + " in visible location."
Else If Parameter("Note5") = "Urethane dept. to stamp molded part no. " + vbCrLf + "<Molded Part Number> in visible location."
	sText5 = "Urethane dept. to stamp molded part no. " + sModelMoldedPartNumber + " in visible location."
Else If Parameter("Note5") = "Electrical Engineering dept. to stamp molded part no. " + vbCrLf + "<Molded Part Number> in visible location."
	sText5 = "Electrical Engineering dept. to stamp molded part no. " + vbCrLf + "     " + sModelMoldedPartNumber + " in visible location."
Else If Parameter("Note5") = "Machine from: <Machine From>"
	sText5 = "Machine from: " + sModelMachinedFrom
Else
	sText5 = Parameter("Note5")
End If

Dim sText6 As String
If Parameter("Note6") = "<Model Comments>" Then
	sText6 = sModelComments
Else If Parameter("Note6") = "<Stock Number>"
	sText6 = sModelStockNumber
Else If Parameter("Note6") = "Etch assembly no. <Part Number> in visible location."
	sText6 = "Etch assembly no. " + sModelPartNumber + " in visible location."
Else If Parameter("Note6") = "Urethane dept. to stamp molded part no. " + vbCrLf + "<Molded Part Number> in visible location."
	sText6 = "Urethane dept. to stamp molded part no. " + sModelMoldedPartNumber + " in visible location."
Else If Parameter("Note6") = "Electrical Engineering dept. to stamp molded part no. " + vbCrLf + "<Molded Part Number> in visible location."
	sText6 = "Electrical Engineering dept. to stamp molded part no. " + vbCrLf + "     " + sModelMoldedPartNumber + " in visible location."
Else If Parameter("Note6") = "Machine from: <Machine From>"
	sText6 = "Machine from: " + sModelMachinedFrom
Else
	sText6 = Parameter("Note6")
End If

Dim sText7 As String
If Parameter("Note7") = "<Model Comments>" Then
	sText7 = sModelComments
Else If Parameter("Note7") = "<Stock Number>"
	sText7 = sModelStockNumber
Else If Parameter("Note7") = "Etch assembly no. <Part Number> in visible location."
	sText7 = "Etch assembly no. " + sModelPartNumber + " in visible location."
Else If Parameter("Note7") = "Urethane dept. to stamp molded part no. " + vbCrLf + "<Molded Part Number> in visible location."
	sText7 = "Urethane dept. to stamp molded part no. " + sModelMoldedPartNumber + " in visible location."
Else If Parameter("Note7") = "Electrical Engineering dept. to stamp molded part no. " + vbCrLf + "<Molded Part Number> in visible location."
	sText7 = "Electrical Engineering dept. to stamp molded part no. " + vbCrLf + "     " + sModelMoldedPartNumber + " in visible location."
Else If Parameter("Note7") = "Machine from: <Machine From>"
	sText7 = "Machine from: " + sModelMachinedFrom
Else
	sText7 = Parameter("Note7")
End If

Dim sText8 As String
If Parameter("Note8") = "<Model Comments>" Then
	sText8 = sModelComments
Else If Parameter("Note8") = "<Stock Number>"
	sText8 = sModelStockNumber
Else If Parameter("Note8") = "Etch assembly no. <Part Number> in visible location."
	sText8 = "Etch assembly no. " + sModelPartNumber + " in visible location."
Else If Parameter("Note8") = "Urethane dept. to stamp molded part no. " + vbCrLf + "<Molded Part Number> in visible location."
	sText8 = "Urethane dept. to stamp molded part no. " + sModelMoldedPartNumber + " in visible location."
Else If Parameter("Note8") = "Electrical Engineering dept. to stamp molded part no. " + vbCrLf + "<Molded Part Number> in visible location."
	sText8 = "Electrical Engineering dept. to stamp molded part no. " + vbCrLf + "     " + sModelMoldedPartNumber + " in visible location."
Else If Parameter("Note8") = "Machine from: <Machine From>"
	sText8 = "Machine from: " + sModelMachinedFrom
Else
	sText8 = Parameter("Note8")
End If

Dim sText9 As String
If Parameter("Note9") = "<Model Comments>" Then
	sText9 = sModelComments
Else If Parameter("Note9") = "<Stock Number>"
	sText9 = sModelStockNumber
Else If Parameter("Note9") = "Etch assembly no. <Part Number> in visible location."
	sText9 = "Etch assembly no. " + sModelPartNumber + " in visible location."
Else If Parameter("Note9") = "Urethane dept. to stamp molded part no. " + vbCrLf + "<Molded Part Number> in visible location."
	sText9 = "Urethane dept. to stamp molded part no. " + sModelMoldedPartNumber + " in visible location."
Else If Parameter("Note9") = "Electrical Engineering dept. to stamp molded part no. " + vbCrLf + "<Molded Part Number> in visible location."
	sText9 = "Electrical Engineering dept. to stamp molded part no. " + vbCrLf + "     " + sModelMoldedPartNumber + " in visible location."
Else If Parameter("Note9") = "Machine from: <Machine From>"
	sText9 = "Machine from: " + sModelMachinedFrom
Else
	sText9 = Parameter("Note9")
End If

Dim sText10 As String
If Parameter("Note10") = "<Model Comments>" Then
	sText10 = sModelComments
Else If Parameter("Note10") = "<Stock Number>"
	sText10 = sModelStockNumber
Else If Parameter("Note10") = "Etch assembly no. <Part Number> in visible location."
	sText10 = "Etch assembly no. " + sModelPartNumber + " in visible location."
Else If Parameter("Note10") = "Urethane dept. to stamp molded part no. " + vbCrLf + "<Molded Part Number> in visible location."
	sText10 = "Urethane dept. to stamp molded part no. " + sModelMoldedPartNumber + " in visible location."
Else If Parameter("Note10") = "Electrical Engineering dept. to stamp molded part no. " + vbCrLf + "<Molded Part Number> in visible location."
	sText10 = "Electrical Engineering dept. to stamp molded part no. " + vbCrLf + "     " + sModelMoldedPartNumber + " in visible location."
Else If Parameter("Note10") = "Machine from: <Machine From>"
	sText10 = "Machine from: " + sModelMachinedFrom
Else
	sText10 = Parameter("Note10")
End If

Dim sText11 As String
If Parameter("Note11") = "<Model Comments>" Then
	sText11 = sModelComments
Else If Parameter("Note11") = "<Stock Number>"
	sText11 = sModelStockNumber
Else If Parameter("Note11") = "Etch assembly no. <Part Number> in visible location."
	sText11 = "Etch assembly no. " + sModelPartNumber + " in visible location."
Else If Parameter("Note11") = "Urethane dept. to stamp molded part no. " + vbCrLf + "<Molded Part Number> in visible location."
	sText11 = "Urethane dept. to stamp molded part no. " + sModelMoldedPartNumber + " in visible location."
Else If Parameter("Note11") = "Electrical Engineering dept. to stamp molded part no. " + vbCrLf + "<Molded Part Number> in visible location."
	sText11 = "Electrical Engineering dept. to stamp molded part no. " + vbCrLf + "     " + sModelMoldedPartNumber + " in visible location."
Else If Parameter("Note11") = "Machine from: <Machine From>"
	sText11 = "Machine from: " + sModelMachinedFrom
Else
	sText11 = Parameter("Note11")
End If

Dim sText12 As String
If Parameter("Note12") = "<Model Comments>" Then
	sText12 = sModelComments
Else If Parameter("Note12") = "<Stock Number>"
	sText12 = sModelStockNumber
Else If Parameter("Note12") = "Etch assembly no. <Part Number> in visible location."
	sText12 = "Etch assembly no. " + sModelPartNumber + " in visible location."
Else If Parameter("Note12") = "Urethane dept. to stamp molded part no. " + vbCrLf + "<Molded Part Number> in visible location."
	sText12 = "Urethane dept. to stamp molded part no. " + sModelMoldedPartNumber + " in visible location."
Else If Parameter("Note12") = "Electrical Engineering dept. to stamp molded part no. " + vbCrLf + "<Molded Part Number> in visible location."
	sText12 = "Electrical Engineering dept. to stamp molded part no. " + vbCrLf + "     " + sModelMoldedPartNumber + " in visible location."
Else If Parameter("Note12") = "Machine from: <Machine From>"
	sText12 = "Machine from: " + sModelMachinedFrom
Else
	sText12 = Parameter("Note12")
End If

Dim sText13 As String
If Parameter("Note13") = "<Model Comments>" Then
	sText13 = sModelComments
Else If Parameter("Note13") = "<Stock Number>"
	sText13 = sModelStockNumber
Else If Parameter("Note13") = "Etch assembly no. <Part Number> in visible location."
	sText13 = "Etch assembly no. " + sModelPartNumber + " in visible location."
Else If Parameter("Note13") = "Urethane dept. to stamp molded part no. " + vbCrLf + "<Molded Part Number> in visible location."
	sText13 = "Urethane dept. to stamp molded part no. " + sModelMoldedPartNumber + " in visible location."
Else If Parameter("Note13") = "Electrical Engineering dept. to stamp molded part no. " + vbCrLf + "<Molded Part Number> in visible location."
	sText13 = "Electrical Engineering dept. to stamp molded part no. " + vbCrLf + "     " + sModelMoldedPartNumber + " in visible location."
Else If Parameter("Note13") = "Machine from: <Machine From>"
	sText13 = "Machine from: " + sModelMachinedFrom
Else
	sText13 = Parameter("Note13")
End If

Dim sText14 As String
If Parameter("Note14") = "<Model Comments>" Then
	sText14 = sModelComments
Else If Parameter("Note14") = "<Stock Number>"
	sText14 = sModelStockNumber
Else If Parameter("Note14") = "Etch assembly no. <Part Number> in visible location."
	sText14 = "Etch assembly no. " + sModelPartNumber + " in visible location."
Else If Parameter("Note14") = "Urethane dept. to stamp molded part no. " + vbCrLf + "<Molded Part Number> in visible location."
	sText14 = "Urethane dept. to stamp molded part no. " + sModelMoldedPartNumber + " in visible location."
Else If Parameter("Note14") = "Electrical Engineering dept. to stamp molded part no. " + vbCrLf + "<Molded Part Number> in visible location."
	sText14 = "Electrical Engineering dept. to stamp molded part no. " + vbCrLf + "     " + sModelMoldedPartNumber + " in visible location."
Else If Parameter("Note14") = "Machine from: <Machine From>"
	sText14 = "Machine from: " + sModelMachinedFrom
Else
	sText14 = Parameter("Note14")
End If

Dim sText15 As String
If Parameter("Note15") = "<Model Comments>" Then
	sText15 = sModelComments
Else If Parameter("Note15") = "<Stock Number>"
	sText15 = sModelStockNumber
Else If Parameter("Note15") = "Etch assembly no. <Part Number> in visible location."
	sText15 = "Etch assembly no. " + sModelPartNumber + " in visible location."
Else If Parameter("Note15") = "Urethane dept. to stamp molded part no. " + vbCrLf + "<Molded Part Number> in visible location."
	sText15 = "Urethane dept. to stamp molded part no. " + sModelMoldedPartNumber + " in visible location."
Else If Parameter("Note15") = "Electrical Engineering dept. to stamp molded part no. " + vbCrLf + "<Molded Part Number> in visible location."
	sText15 = "Electrical Engineering dept. to stamp molded part no. " + vbCrLf + "     " + sModelMoldedPartNumber + " in visible location."
Else If Parameter("Note15") = "Machine from: <Machine From>"
	sText15 = "Machine from: " + sModelMachinedFrom
Else
	sText15 = Parameter("Note15")
End If

Dim sText16 As String
If Parameter("Note16") = "<Model Comments>" Then
	sText16 = sModelComments
Else If Parameter("Note16") = "<Stock Number>"
	sText16 = sModelStockNumber
Else If Parameter("Note16") = "Etch assembly no. <Part Number> in visible location."
	sText16 = "Etch assembly no. " + sModelPartNumber + " in visible location."
Else If Parameter("Note16") = "Urethane dept. to stamp molded part no. " + vbCrLf + "<Molded Part Number> in visible location."
	sText16 = "Urethane dept. to stamp molded part no. " + sModelMoldedPartNumber + " in visible location."
Else If Parameter("Note16") = "Electrical Engineering dept. to stamp molded part no. " + vbCrLf + "<Molded Part Number> in visible location."
	sText16 = "Electrical Engineering dept. to stamp molded part no. " + vbCrLf + "     " + sModelMoldedPartNumber + " in visible location."
Else If Parameter("Note16") = "Machine from: <Machine From>"
	sText16 = "Machine from: " + sModelMachinedFrom
Else
	sText16 = Parameter("Note16")
End If

Dim sText17 As String
If Parameter("Note17") = "<Model Comments>" Then
	sText17 = sModelComments
Else If Parameter("Note17") = "<Stock Number>"
	sText17 = sModelStockNumber
Else If Parameter("Note17") = "Etch assembly no. <Part Number> in visible location."
	sText17 = "Etch assembly no. " + sModelPartNumber + " in visible location."
Else If Parameter("Note17") = "Urethane dept. to stamp molded part no. " + vbCrLf + "<Molded Part Number> in visible location."
	sText17 = "Urethane dept. to stamp molded part no. " + sModelMoldedPartNumber + " in visible location."
Else If Parameter("Note17") = "Electrical Engineering dept. to stamp molded part no. " + vbCrLf + "<Molded Part Number> in visible location."
	sText17 = "Electrical Engineering dept. to stamp molded part no. " + vbCrLf + "     " + sModelMoldedPartNumber + " in visible location."
Else If Parameter("Note17") = "Machine from: <Machine From>"
	sText17 = "Machine from: " + sModelMachinedFrom
Else
	sText17 = Parameter("Note17")
End If

Dim sNote1 As String
Dim sNote2 As String
Dim sNote3 As String
Dim sNote4 As String
Dim sNote5 As String
Dim sNote6 As String
Dim sNote7 As String
Dim sNote8 As String
Dim sNote9 As String
Dim sNote10 As String
Dim sNote11 As String
Dim sNote12 As String
Dim sNote13 As String
Dim sNote14 As String
Dim sNote15 As String
Dim sNote16 As String
Dim sNote17 As String


If sText1 <> "-" Then
	'Dim sNote1 As String
	sNote1 = "1.  " + sText1
		
End If

If sText2 <> "-" Then
	'Dim sNote2 As String
	sNote2 = "2.  " + sText2
		
End If

If sText3 <> "-" Then
	'Dim sNote3 As String
	sNote3 = "3.  " + sText3
		
End If

If sText4 <> "-" Then
	'Dim sNote4 As String
	sNote4 = "4.  " + sText4
		
End If

If sText5 <> "-" Then
	'Dim sNote5 As String
	sNote5 = "5.  " + sText5
	
End If

If sText6 <> "-" Then
	'Dim sNote6 As String
	sNote6 = "6.  " + sText6
	
End If

If sText7 <> "-" Then
	'Dim sNote7 As String
	sNote7 = "7.  " + sText7
	
End If

If sText8 <> "-" Then
	'Dim sNote8 As String
	sNote8 = "8.  " + sText8
	
End If

If sText9 <> "-" Then
	'Dim sNote9 As String
	sNote9 = "9.  " + sText9
	
End If

If sText10 <> "-" Then
	'Dim sNote10 As String
	sNote10 = "10.  " + sText10
	
End If

If sText11 <> "-" Then
	'Dim sNote11 As String
	sNote11 = "11.  " + sText11
	
End If

If sText12 <> "-" Then
	'Dim sNote12 As String
	sNote12 = "12.  " + sText12
	
End If

If sText13 <> "-" Then
	'Dim sNote13 As String
	sNote13 = "13.  " + sText13
	
End If

If sText14 <> "-" Then
	'Dim sNote14 As String
	sNote14 = "14.  " + sText14
	
End If

If sText15 <> "-" Then
	'Dim sNote15 As String
	sNote15 = "15.  " + sText15
	
End If

If sText16 <> "-" Then
	'Dim sNote16 As String
	sNote16 = "16.  " + sText16
	
End If

If sText17 <> "-" Then
	'Dim sNote17 As String
	sNote17 = "17.  " + sText17
	
End If



' Build the Note
Dim sNoteAll As String = ""
AddNote(sNoteAll, sNote1)
AddNote(sNoteAll, sNote2)
AddNote(sNoteAll, sNote3)
AddNote(sNoteAll, sNote4)
AddNote(sNoteAll, sNote5)
AddNote(sNoteAll, sNote6)
AddNote(sNoteAll, sNote7)
AddNote(sNoteAll, sNote8)
AddNote(sNoteAll, sNote9)
AddNote(sNoteAll, sNote10)
AddNote(sNoteAll, sNote11)
AddNote(sNoteAll, sNote12)
AddNote(sNoteAll, sNote13)
AddNote(sNoteAll, sNote14)
AddNote(sNoteAll, sNote15)
AddNote(sNoteAll, sNote16)
AddNote(sNoteAll, sNote17)

'MessageBox.Show(sNoteAll, "Title")


'Place the note
Dim oNoteAll As GeneralNote
oNoteAll = oGeneralNotes.AddFitted(oTG.CreatePoint2d(dXCoord, dYCoord), sNoteAll)
oNoteAll.Rotation = oRotation
oNoteAll.Width = oSetWidth

End Sub

Sub AddNote(ByRef sNoteAll As String, sNote As String)
	If (Not String.IsNullOrEmpty(sNote)) Then
		If (Not String.IsNullOrEmpty(sNoteAll)) Then
			sNoteAll = sNoteAll + vbCrLf
		End If
		sNoteAll = sNoteAll + sNote
	End If
End Sub

It seems very complicated when I lay it out like this.

 

Mechanix Design Solutions inc.
615 Views
1 Reply
Reply (1)
Message 2 of 2

chandra.shekar.g
Autodesk Support
Autodesk Support

@cmcconnell,

 

Thanks for sharing your experience in iLogic.

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes