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?
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?
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.
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.
What's the setting for the horizontal text justification?
What's the setting for the horizontal text justification?
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.
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.
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.
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.
Can't find what you're looking for? Ask the community or share your knowledge.