Inventor Customization

Inventor Customization

Reply
Valued Contributor
planglais
Posts: 61
Registered: ‎03-10-2011
Message 1 of 2 (135 Views)
Accepted Solution

Doing translation on an arrow of a leader

135 Views, 1 Replies
04-23-2012 07:02 AM

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

 

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

 

 

 

Valued Contributor
planglais
Posts: 61
Registered: ‎03-10-2011
Message 2 of 2 (129 Views)

Re: Doing translation on an arrow of a leader

04-23-2012 07:55 AM in reply to: planglais

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

 

 

 

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!