- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hey everyone,
I'm just getting started with AutoLISP and I’ve written my first script (with a lot of help from AI 😅). The goal is to create a sequence of arrows in AutoCAD. Each arrow is made up of a block reference and a piece of MText. The label on the MText includes a letter (like "P") followed by an incrementing number (e.g., P1, P2, P3…).
Right now, the script is mostly working:
✅It inserts the block
✅It adds the MText label
✅The numbering increments correctly
The problem is with rotation — the arrows aren’t aligning with the direction I’m pointing during placement. Instead, they seem to rotate in a direction as if following a tangent to a circle formed between the original block and the new insertion point, rather than facing directly toward that point.
I’m completely new to AutoLISP and scripting in general, so I'm not sure how to properly calculate or apply the rotation angle based on the direction input.
If anyone could point me in the right direction or offer some advice, I’d really appreciate it. I’ve included the code below for reference.
Thanks in advance! 🙏
edit - Attached a sample DWG with an arrow(minus the grip that the original has for turning it) and the command loaded.
edit - Attached a second DWG that has a better design provided by ВeekeeCZ while helping me find a solution in this post.
Solved! Go to Solution.