Message 1 of 13
Creating a dynamic model annotation of a user parameter using XML tags
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I need to create a model general note that is dynamically linked to a user parameter that contains text. I have referred to the official documentation and tried various different combinations of xml tags, yet always get the "Incorrect parameter" error.
I also used the reverse method to get the logger to print the formatted text for me by using 'Thisapplication.Commandmanager.pick(kModelannotationFilter, "Pick your model annotation") and just gave that exact same output as input to my code - yet couldn't get it to work. I continue to get the "incorrect parameter" error.
Have a look at my code:
Dim Pdoc as Document = Thisapplication.activedocument
Dim MAS As ModelAnnotations = Pdoc.ComponentDefinition.ModelAnnotations
Dim MGNS As ModelGeneralNotes = MAS.ModelGeneralNotes
Dim AnnotationText As String = "<Parameter Resolved='True' ComponentIdentifier='C:\Workingfolder\Saddle.ipt' Name='BRS'
Precision='3'></Parameter>"
'The above text is exactly what I got when using logger to print the formatted text
'BRS is the name of the user parameter and it is a multivalue with two values 'General'and 'custom'
Dim MGN As ModelGeneralNote
Dim MGNDef As ModelGeneralNoteDefinition = MGNS.CreateDefinition(AnnotationText, True, kUpperLeftQuadrant)
Dim NewMGN As ModelGeneralNote = MGNS.Add(MGNDef)
NewMGN.Name = "Standard-Indicator"
NewMGN.Visible = True