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: 

Placing hole notes accurately is impossible

4 REPLIES 4
Reply
Message 1 of 5
shastu
284 Views, 4 Replies

Placing hole notes accurately is impossible

Please see the video attached.  This is just for demonstration purposes but let's assume that I want to place the hole note text precisely at x position of 30 and y position of 20.  In my code I specifically set both the oPosition.x, oHN.Text.Origin.x, Oposition.y, and oHN.Text.Origin.y.  Just to prove my point, I did the same thing again and set everything again to the same values.  So in theory the first time the oHN.Text.Origin - oPosition is executed, the hole note should move to a 30,20 location.  Then as it continues through the code, the next time the oHN.Text.Origin - oPosition  is executed, the hole note should not move because it is already in that location, but it does.  Why oh why does this happen?

4 REPLIES 4
Message 2 of 5
shastu
in reply to: shastu

This should help show the problem.  See video.  I set the oHN.Text.Origin = oPosition.  As you can see in the watch window, the values of the oHN.Text.Origin should be 30 and 20, but instead they come in at 27.0325996541975 and 19.999999999999998.

 

https://autode.sk/3N28hkh

Message 3 of 5
MICHAEL.JONES.AMCE
in reply to: shastu

What's the setting for the horizontal text justification?

Message 4 of 5
shastu
in reply to: shastu

I have tried messing with text justification, but that is not part of the problem.  Without changing the text justification, I get different placement of the hole note depending on where it started.  The Y value works as it should.  No matter how high or low I place the holenote before running the program, it always goes down to the same place.  But the x value should go to the exact same place left of right, no matter where the hole note starts and it doesn't.  See video.  In the video, the text justification, never changes, but I still don't get the same results.

Message 5 of 5
MjDeck
in reply to: shastu

It looks like it's not possible to modify the X position of the text for an existing hole note. You can set the Y value, but there are constraints on X. The hole note has a leader, but it is not available in the API. This is a problem on Inventor 2021, and probably on later versions as well.
The only thing I can recommend is to create the HoleThreadNote from scratch with the API. That should give you more control over text position than moving an existing note.


Mike Deck
Software Developer
Autodesk, Inc.

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

Post to forums  

Autodesk Design & Make Report