Attach custom sketchsymbol to drawingcurve and check AttachedEntity

Attach custom sketchsymbol to drawingcurve and check AttachedEntity

Anonymous
Not applicable
405 Views
1 Reply
Message 1 of 2

Attach custom sketchsymbol to drawingcurve and check AttachedEntity

Anonymous
Not applicable

I have a code that attaches custom sketched symbol to drawing curve:

        Dim oTG As TransientGeometry
        Set oTG = ThisApplication.TransientGeometry
        
        Dim oLeaderPoints As ObjectCollection
        
        Set oLeaderPoints = ThisApplication.TransientObjects.CreateObjectCollection
        Call oLeaderPoints.Add(oTG.CreatePoint2d(oCurvePoint.X + 2, oCurvePoint.Y + 2))
        
        Dim oGeometryIntent As GeometryIntent
        Set oGeometryIntent = oActiveSheet.CreateGeometryIntent(oDrawingCurve, oCurvePoint)
        Call oLeaderPoints.Add(oGeometryIntent.Intent)
        Dim sPS(0) As String
        sPS(0) = oBOM_Text
        Call oActiveSheet.SketchedSymbols.AddWithLeader("CUSTOM_BALLOON", oLeaderPoints, , , sPS, , True

This code works just fine. Problems is that when I place symbol using this code, leader does not have info on AttachedEntity:

 

AE_nothing.png

If I manually re-attach same symbol against drawing curve info on AttachedEntity shows up:

AE_something.png

I thought that GeometryIntent actually places leader against drawingcurve at certain point but this is not the case.

How can I place symbol with leader and leader to have info for AttachedEntity?

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

Anonymous
Not applicable
Accepted solution

I figured it out:

Set oGeometryIntent = oActiveSheet.CreateGeometryIntent(oDrawingCurve, oCurvePoint)
Call oLeaderPoints.Add(oGeometryIntent)

 

0 Likes