iLogic Format Text for 3D Annotate Notes

iLogic Format Text for 3D Annotate Notes

vyivanchikov
Enthusiast Enthusiast
448 Views
1 Reply
Message 1 of 2

iLogic Format Text for 3D Annotate Notes

vyivanchikov
Enthusiast
Enthusiast

Good day!
Please advise how to implement in 3d modeling environment 3d annotations using ilogic
custom properties G_L, G_B
Earlier post was published how to make standard properties such as Material, Designation

https://forums.autodesk.com/t5/inventor-ilogic-and-vb-net-forum/help-ilogic-format-text-for-3d-annot...

Code

Dim oDoc As PartDocument
oDoc = ThisDoc.Document 

'Logger.Info(oDoc.ComponentDefinition.ModelAnnotations.ModelGeneralNotes.Item(1).Definition.Text.FormattedText)

oFormat = "Partnumber:<Property Document='model' FormatID='{32853F0F-3444-11D1-9E93-0060B03C1CA6}' PropertyID='5'>PART NUMBER</Property><Br/>Material: <Property Document='model' FormatID='{32853F0F-3444-11D1-9E93-0060B03C1CA6}' PropertyID='20'>MATERIAL</Property><Br/>Mass: <PhysicalProperty PhysicalPropertyID='72449' Precision='2'>MASS</PhysicalProperty>"
'create definition
Dim oGennotedef As ModelGeneralNoteDefinition
oGennotedef= oDoc.ComponentDefinition.ModelAnnotations.ModelGeneralNotes.CreateDefinition(oFormat, True, ScreenQuadrantEnum.kLowerRightQuadrant)
'add to model
Dim oGennote As ModelGeneralNote
oGennote = oDoc.ComponentDefinition.ModelAnnotations.ModelGeneralNotes.Add(oGennotedef)

 

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

JhoelForshav
Mentor
Mentor
Accepted solution

Hi @vyivanchikov 

I edited the code sample you provided to give you custom properties G_L and G_B. Is this what youre looking for?

Dim oDoc As PartDocument
oDoc = ThisDoc.Document 

oFormat = "G_L: <Property Document='model' PropertySet='User Defined Properties' Property='G_L' FormatID='{D5CDD505-2E9C-101B-9397-08002B2CF9AE}'>G_L</Property><Br/>G_B: <Property Document='model' PropertySet='User Defined Properties' Property='G_B' FormatID='{D5CDD505-2E9C-101B-9397-08002B2CF9AE}'>G_B</Property>"
'create definition
Dim oGennotedef As ModelGeneralNoteDefinition
oGennotedef= oDoc.ComponentDefinition.ModelAnnotations.ModelGeneralNotes.CreateDefinition(oFormat, True, ScreenQuadrantEnum.kLowerRightQuadrant)
'add to model
Dim oGennote As ModelGeneralNote
oGennote = oDoc.ComponentDefinition.ModelAnnotations.ModelGeneralNotes.Add(oGennotedef)