Trying to relocate nodes and text on Chamfer Note Object; text moves, nodes dont

Trying to relocate nodes and text on Chamfer Note Object; text moves, nodes dont

rfink
Enthusiast Enthusiast
500 Views
4 Replies
Message 1 of 5

Trying to relocate nodes and text on Chamfer Note Object; text moves, nodes dont

rfink
Enthusiast
Enthusiast

I am trying to automatically relocate text and leader nodes on a Chamfer Note Object when view scales and model sizes change.

 

I can get the text position to move, but the I can't get the leader nodes. Here's the code:

 

   Set oDimensions = oSheet.DrawingNotes.ChamferNotes
       
            For Each oChamferNote In oDimensions
          
            For Each oLeaderNode In oChamferNote.Leader.AllNodes
            oLeaderNode.Position.x = oLeaderNode.Position.x - 5
            oLeaderNode.Position.Y = oLeaderNode.Position.Y + 5
            Next
           
            Next

 

 

0 Likes
501 Views
4 Replies
Replies (4)
Message 2 of 5

JaneFan
Autodesk
Autodesk

Hey @rfink,

 

Please try setting the position with a Point2d object instead of setting the coordinates separately:

Sub Test()
    Dim oNotes As DrawingNotes
    Set oNotes = ThisApplication.ActiveDocument.ActiveSheet.DrawingNotes
    
    Dim oLeader As Object
    Dim oChamL As ChamferNote
    
    Dim oPt As Point2d
    For Each oLeader In oNotes.LeaderNotes
        Set oPt = ThisApplication.TransientGeometry.CreatePoint2d(oLeader.Position.X - 5, oLeader.Position.Y - 2)
        oLeader.Position = oPt
    Next
    For Each oChamL In oNotes.ChamferNotes
        Set oPt = ThisApplication.TransientGeometry.CreatePoint2d(oChamL.Position.X + 5, oChamL.Position.Y - 2)
        oChamL.Position = oPt
    Next
End Sub




Jane Fan
Inventor/Fusion QA Engineer
Message 3 of 5

rfink
Enthusiast
Enthusiast

Thanks Jane,

 

Is there some ref material that itemizes exactly what a root node, leaf node, and child nodes are for any given leader?

 

Thanks Again!

0 Likes
Message 4 of 5

rfink
Enthusiast
Enthusiast

Jane, 

 

Is there some way to get a reference to a Hole Thread Note Leader and associated Nodes?

 

I am having troube creating Hole Thread Notes because the leader always crosses over the hole!

 

 

Thanks!

0 Likes
Message 5 of 5

JaneFan
Autodesk
Autodesk

Please install inventor developer tools from here: C:\Users\Public\Documents\Autodesk\Inventor 20xx\SDK\Developertools.msi.

After installation, .\DeveloperTools\Docs\Inventor20xxObjectModel.pdf shows the objects structure of inventor API.




Jane Fan
Inventor/Fusion QA Engineer
0 Likes