cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

[BUG] API/iLogic - Leaders - creating or setting a GeometryIntent based on a FeatureControlFrame fails

[BUG] API/iLogic - Leaders - creating or setting a GeometryIntent based on a FeatureControlFrame fails

When using the API to move the attachment point of leaders on a drawing with GeometryIntents the code will fail when the intent is a FeatureControlFrame.

 

Steps to reproduce:

Create the following VBA function: (The functions moves the attached leaderpoint 1 mm down)

Sub Bug_FeatureControlFrameAsIntent()
    
    Dim DrawDoc As DrawingDocument
    Set DrawDoc = ThisApplication.ActiveDocument
    
    Dim L As Leader
    Set L = DrawDoc.SelectSet(1).Leader
    
    Dim LeaderPoint As LeaderNode
    Set LeaderPoint = L.RootNode.ChildNodes(1)
    
    Dim AttachedGeometry As Object
    Set AttachedGeometry = LeaderPoint.AttachedEntity.Geometry
    
    Dim NewPoint As Point2d
    Set NewPoint = LeaderPoint.Position.Copy
    
    NewPoint.Y = NewPoint.Y - 0.1 'Move point 1 mm down on the sheet
    
    Dim NewIntent As GeometryIntent
    Set NewIntent = DrawDoc.ActiveSheet.CreateGeometryIntent(AttachedGeometry, NewPoint)
    
    LeaderPoint.AttachedEntity = NewIntent
    
End Sub

 

Place on your drawing items with a leader (Leader Text will do, but it works als with Feature Control Frame)

Make sure you attach them to vertical objects because the code move the point vertical and reattaches the leader

 

ACEDeSmedt_0-1594814253205.png

 

Select one item with a leader and run the function.

 

The function will throw an error when the leader is attached to a feature control frame.

 

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

Submit Idea