Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Add to general note <MASS> parameter

1 REPLY 1
SOLVED
Reply
Message 1 of 2
Damian_Apex
460 Views, 1 Reply

Add to general note <MASS> parameter

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

 

1 REPLY 1
Message 2 of 2
Ralf_Krieg
in reply to: Damian_Apex

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 GmbH
www.rkw-solutions.com

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report