Hello,
I'm looking for a piece code in which I can give <MASS> parameter in general note on drawing.
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
Solved! Go to Solution.
Solved by Ralf_Krieg. Go to 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"
Can't find what you're looking for? Ask the community or share your knowledge.