Message 1 of 2
Inserting physical properties into drawing notes programmatically
Not applicable
06-05-2024
11:53 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I'm simply trying to insert the <MASS> physical property into a drawing note, through the `DrawingNote.FormattedText` property.
When the note is nothing but manually entered text, or when the physical property exists already, it's fine; but when the note contains a user parameter, it causes the whole string to become unformatted and show just the XML-ish string instead.
Here is the process I am using. The property-invoking string I got from inspecting a note with this already inserted manually.
Sub Main()
Dim oApp As Application = ThisApplication
Dim oDoc As DrawingDocument = ThisDoc.Document
Dim sUndoTrnsName As String = "Insert Mass"
Dim trnsUndo As Transaction = oApp.TransactionManager.StartTransaction(oDoc, sUndoTrnsName)
For Each oSheet As Sheet In oDoc.Sheets
For Each oNote As DrawingNote In oSheet.DrawingNotes
oNote.FormattedText = oNote.FormattedText + "<PhysicalProperty PhysicalPropertyID='72449' Precision='3'>MASS</PhysicalProperty>"
Next
Next
trnsUndo.End
End Sub