Hi everyone,
I’m working on an AutoCAD VBA script that calculates and places angular dimensions at the vertices of a closed polyline. Everything is working fine except one thing: I need to ensure that the text position (TextPoint) for the angular dimensions is always inside the polyline.
Currently, I'm calculating TextPoint using the angle at each vertex, but sometimes it ends up outside the polyline. To fix this, I’ve tried implementing a ray-casting algorithm to check if TextPoint is inside the polyline. If it’s outside, I attempt to adjust it by moving it closer to the vertex. However, this approach doesn’t always work perfectly, and I’m not sure if it’s the most efficient method.
Here’s my current code:
Is there a better way to ensure that TextPoint is always inside the polyline? Or can someone suggest improvements to my current ray-casting and adjustment method?
Any help or suggestions would be greatly appreciated!
Thanks in advance!
jefferson