Add to general note <MASS> parameter

Add to general note <MASS> parameter

Damian_Apex
Enthusiast Enthusiast
649 Views
1 Reply
Message 1 of 2

Add to general note <MASS> parameter

Damian_Apex
Enthusiast
Enthusiast

Hello,

I'm looking for a piece code in which I can give <MASS> parameter in general note on drawing.

damianmarondelKC4WU_0-1631794424811.png

 

This is my code to create general note on drawing and I want to create new general note little above it with <MASS> parameter

 

Sub main
Dim oAssemblyDoc As Inventor.AssemblyDocument
oAssemblyDoc = ThisApplication.ActiveDocument
Dim oDoc As Document

Dim Path As String = ThisDoc.Path & "\"
Dim SourceFileName As String = ThisDoc.FileName(True)

Dim oModelName As String = Path & SourceFileName
oDoc = ThisApplication.Documents.Open(oModelName, False)

Dim oDrgDoc As DrawingDocument
oDrgDoc = ThisApplication.Documents.Add(kDrawingDocumentObject, "C:\Work\iLogic\Templates\en-US" & "\" & "APEX TEMPLATE DWG.idw")

Dim oSheet As Sheet
oSheet = oDrgDoc.Sheets.Item(1)

AddNote(oSheet)
end sub

Public Sub AddNote(oSheet As Sheet)
SetNotePath = "C:\Work\Library\NOTES\FABRICATION NOTES DWG-A.F.S.txt"

Dim
oGeneralNotes As GeneralNotes
oGeneralNotes = oSheet.DrawingNotes.GeneralNotes

Dim
nTG As TransientGeometry nTG = ThisApplication.TransientGeometry

oRead
= System.IO.File.OpenText(SetNotePath)
EntireFile = oRead.ReadToEnd oRead.Close()
Dim sText As String sText = EntireFile

Dim
nBorder As Border nBorder = oSheet.Border

oGeneralNote
= oGeneralNotes.AddFitted(nTG.CreatePoint2d(nBorder.RangeBox.MaxPoint.X-10, nBorder.RangeBox.MaxPoint.Y-15), sText) 'Top Left below BOM
oGeneralNote.HorizontalJustification = kAlignTextLeft
End Sub

 

0 Likes
Accepted solutions (1)
650 Views
1 Reply
Reply (1)
Message 2 of 2

Ralf_Krieg
Advisor
Advisor
Accepted solution

Hello

 

To add the MASS parameter, you need to edit the FormattedText Property of the GeneralNote. AFAIK it's not possible to create the note direct with this. I would try to create the note with a very simple text and replace the value of the FormattedText property right after with the string "WEIGHT PER 1 AS SHOWN (kg): <PhysicalProperty PhysicalPropertyID='72449' Precision='3'>MASS</PhysicalProperty><Br/>TOTAL 2 REQUIRED FOR 1 UNIT"

 


R. Krieg
RKW Solutions
www.rkw-solutions.com
0 Likes