Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Doing translation on an arrow of a leader

1 REPLY 1
SOLVED
Reply
Message 1 of 2
planglais75
305 Views, 1 Reply

Doing translation on an arrow of a leader

Hi,

 

I try to move, by translation, an arrow of a leader but my code doing nothing.

 

My code:

 

Dim oDrawDoc As Inventor.DrawingDocument
oDrawDoc = oApp.ActiveDocument

 

Dim oSheets As Inventor.Sheets
oSheets = oDrawDoc.Sheets

 

Dim oSheet As Inventor.Sheet
oSheet = oSheets(1)

 

Dim oTG As Inventor.TransientGeometry

oTG = oApp.TransientGeometry

 

 

Dim oBalloon As Inventor.Balloon

Dim index As Integer

For index = 1 To oSheet.Balloons.Count

    Dim oTranslation As Inventor.Vector2d

    oTranslation = oTG.CreateVector2d(20, 20)

 

    oBalloon = oSheet.Balloons(index)

 

    Dim oArrowPosition as Inventor.Point2d

    oArrowPosition = oBalloon.Leader.AllLeafNodes(1).Position

    oArrowPosition.TranslateBy(oTranslation)
Next


oSheet.Update()

 

 

 

Thanks for help.

 

Pascal

 

1 REPLY 1
Message 2 of 2
planglais75
in reply to: planglais75

Ok, I found my answer: use CreatePoint2d method instead of CreateVector2D of TransientGeometry:

 

Dim oNewPosition As Inventor.Vector2d

oNewPosition = oTG.CreatePoint2d(20, 20)

 

oBalloon = oSheet.Balloons(index)

 

Dim oArrow as Inventor.LeaderNode

oArrow = oBalloon.Leader.AllLeafNodes(1)

 

oArrow.Position = oNewPosition

 

 

 

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

Post to forums  

Autodesk Design & Make Report