Create Leader Note with the properties model- part number

Create Leader Note with the properties model- part number

Anonymous
Not applicable
418 Views
1 Reply
Message 1 of 2

Create Leader Note with the properties model- part number

Anonymous
Not applicable

Hi, i was trying to create an automated annotation tag but through ilogic but this is what i have so far..

 

Dim oDoc As DrawingDocument
oDoc = ThisApplication.ActiveDocument
Dim s As String
s = "<StyleOverride Font='Arial'><Parameter Resolved='True' ComponentIdentifier='C:\Users\hanb\Documents\Disc.ipt' Name='HoleQuantity' Precision='0'>8</Parameter></StyleOverride><StyleOverride Font='Arial'> HOLES ON DIA </StyleOverride><StyleOverride Font='Arial'><Parameter Resolved='True' ComponentIdentifier='C:\Users\hanb\Documents\Disc.ipt' Name='HolePCD' Precision='0'>35</Parameter></StyleOverride><StyleOverride Font='Arial'>±0.1 </StyleOverride><Br/><StyleOverride Font='Arial'>WITH </StyleOverride><StyleOverride Font='Arial'><Parameter Resolved='True' ComponentIdentifier='C:\Users\hanb\Documents\Disc.ipt' Name='HoleQuantity' Precision='0'>8</Parameter></StyleOverride><StyleOverride Font='Arial'> DIVISIONS</StyleOverride>"
 
Dim curve As DrawingCurve
curve = oDoc.SelectSet.Item(1).Parent
Dim oGI1 As GeometryIntent
oGI1 = oDoc.ActiveSheet.CreateGeometryIntent(curve, kCenterPointIntent)
 
Dim pt As Point2d
pt = ThisApplication.TransientGeometry.CreatePoint2d
 
pt.X = curve.CenterPoint.X + 3
pt.Y = curve.CenterPoint.Y + 5
 
Dim oObjCol As ObjectCollection
oObjCol = ThisApplication.TransientObjects.CreateObjectCollection
oObjCol.Addpt
oObjCol.AddoGI1
 
Dim oLN As LeaderNote
' create a LeaderNote.
oLN = oDoc.ActiveSheet.DrawingNotes.LeaderNotes.Add(oObjCol, "")
oLN.FormattedText = s

 

0 Likes
419 Views
1 Reply
Reply (1)
Message 2 of 2

JelteDeJong
Mentor
Mentor

i changed your code a bit. try this:

Dim oDoc As DrawingDocument
oDoc = ThisApplication.ActiveDocument
Dim s As String
s = "<Property Document='model' PropertySet='Design Tracking Properties' Property='Appearance' FormatID='{32853F0F-3444-11D1-9E93-0060B03C1CA6}' PropertyID='72'>APPEARANCE</Property>"
Dim curve As DrawingCurve
curve = oDoc.SelectSet.Item(1).Parent
Dim oGI1 As GeometryIntent
oGI1 = oDoc.ActiveSheet.CreateGeometryIntent(curve, PointIntentEnum.kCenterPointIntent)

Dim pt As Point2d
pt = ThisApplication.TransientGeometry.CreatePoint2d

pt.X = oGI1.PointOnSheet.X + 3
pt.Y = oGI1.PointOnSheet.Y + 3

Dim oObjCol As ObjectCollection
oObjCol = ThisApplication.TransientObjects.CreateObjectCollection
oObjCol.Add(pt)
oObjCol.Add(oGI1)

Dim oLN As LeaderNote
' create a LeaderNote.
oLN = oDoc.ActiveSheet.DrawingNotes.LeaderNotes.Add(oObjCol, "efadva")
oLN.FormattedText = s

i did have some with your formated string. so i changed it to show the Appearance iProperty. You probaly need something else. there for this rule that will shows the formated string of an leader that you need to select.

Dim test As LeaderNote = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingNoteFilter, "")
MsgBox(test.FormattedText)

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

0 Likes