Linked User Parameters in iLogic Generated Drawing Notes

Linked User Parameters in iLogic Generated Drawing Notes

dustinbagley
Advocate Advocate
198 Views
1 Reply
Message 1 of 2

Linked User Parameters in iLogic Generated Drawing Notes

dustinbagley
Advocate
Advocate

I would like to create a set of drawing notes with a rule as seen below. However, instead of hard coding the notes into the rule, I would like the rule to add user parameters from the model to the text in a way that retains the link so that as the user parameter changes, the text updates automatically. 

Sub Main()

    Dim oDrawDoc As DrawingDocument
    oDrawDoc = ThisApplication.ActiveDocument

    Dim oActiveSheet As Sheet
    oActiveSheet = oDrawDoc.ActiveSheet
    
 
    Dim oGeneralNotes As GeneralNotes
    oGeneralNotes = oActiveSheet.DrawingNotes.GeneralNotes
    
    Dim oTG As TransientGeometry
    oTG = ThisApplication.TransientGeometry


    Dim sText As String
	Dim Note1 As String
	Dim Note2 As String
	Dim Note3 As String
	Dim Note4 As String
	Dim Note5 As String
	Dim Note6 As String
	
	sText = "<StyleOverride Italic = 'True' Underline = 'True'>NOTES:</StyleOverride><Br/> <Br/>"
	Note1 = "1...<Br/> <Br/>"
	Note2 = "2...<Br/> <Br/>"
	Note3 = "3..."
	Note4 = ""
	Note5 = ""
	Note6 = ""	
    
    Dim oGeneralNote As GeneralNote
    oGeneralNote = oGeneralNotes.AddFitted(oTG.CreatePoint2d(3, 6.75), sText  & Note1 & Note2 & Note3 & Note4 & Note5 & Note6)
	oGeneralNote.VerticalJustification = VerticalTextAlignmentEnum.kAlignTextLower
	oGeneralNote.Width = 30
End Sub

 

0 Likes
199 Views
1 Reply
Reply (1)
Message 2 of 2

A.Acheson
Mentor
Mentor

Here is the snippet "oGeneralNote.FormattedText" that would retrieve the formatted text from a general note.

The rule below functions by retrieving the formatted text from the first general note placed on the drawing with manually placed linked parameter "G_L". Then uses that in General Note 2 added. 

Hopefully this will be of help to your questions. 

 

Sub Main()

    Dim oDrawDoc As DrawingDocument
    oDrawDoc = ThisApplication.ActiveDocument

    Dim oActiveSheet As Sheet
    oActiveSheet = oDrawDoc.ActiveSheet
    
 
    Dim oGeneralNotes As GeneralNotes
    oGeneralNotes = oActiveSheet.DrawingNotes.GeneralNotes
    
	Call GetFormattedText(oGeneralNotes)
	
    Dim oTG As TransientGeometry
    oTG = ThisApplication.TransientGeometry


    Dim sText As String
	Dim Note1 As String
	Dim Note2 As String
	Dim Note3 As String
	Dim Note4 As String
	Dim Note5 As String
	Dim Note6 As String
	
	sText = "<StyleOverride Italic = 'True' Underline = 'True'>NOTES:</StyleOverride><Br/> <Br/>"
	Note1 = "1...<Br/> <Br/>"
	Note2 = "2...<Br/> <Br/>"
	Note3 = "3..." & sFormattedText
	Note4 = ""
	Note5 = ""
	Note6 = ""	
    
    Dim oGeneralNote As GeneralNote
    oGeneralNote = oGeneralNotes.AddFitted(oTG.CreatePoint2d(3, 6.75), sText  & Note1 & Note2 & Note3 & Note4 & Note5 & Note6)
	oGeneralNote.VerticalJustification = VerticalTextAlignmentEnum.kAlignTextLower
	oGeneralNote.Width = 30

End Sub
Dim sFormattedText As String
Sub GetFormattedText(oGeneralNotes)
	 Dim oGeneralNote As GeneralNote = oGeneralNotes(1)
	sFormattedText = InputBox("","FormattedText",oGeneralNote.FormattedText)
End Sub

 

 

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes