Anonymous
377 Views, 1 Reply
01-30-2020
09:07 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
01-30-2020
09:07 AM
Create Leader Note with the properties model- part number
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
01-30-2020
10:34 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
01-30-2020
10:34 AM
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 = si 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.
Blog: hjalte.nl - github.com