- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, I am facing a weird issue with a command from a lisp I created and the tool palette.
My lisp (which I have heavily stripped down for demo/debugging purposes) just creates a rectangle from 2 points. From this lisp I created a tool which I placed in a palette. In the properties of the tool, I set the layer to my liking. The problem is that when I use this tool for the 1st time when I open Autocad, the rectangle is not created on the specified layer, but in whatever the current layer is. But every subsequent time I use the tool, either is the same drawing or in a new drawing, the rectangle is drawn on the correct layer (the one that is specified inside the tool properties)! This works correctly until I close autocad. Next time I open it, the same happens. The 1st time the layer is wrong, all subsequent times the layer is correct.
In sort, the steps to reproduce are:
1. Open Autocad.
2. Load the attached lisp file.
3. Create a line or whatever tool in a palette.
4. In the tool properties, set use flyout to no and change the command string to this ^C^C_topogridcross
5. In the tool properties, set the layer to any layer you like, except 0 or the current layer of your drawing.
6. Use the tool. --> You should get the rectangle on the wrong layer.
7. Use the tool again. --> You should now get the rectangle on the correct layer!
8. Create a new drawing. Use the tool. --> You should get the rectangle on the correct layer!
9. Close Autocad.
10. Repeat steps 1-8. --> You should see the same results.
Can anyone explain what's going on? It's driving me crazy. I guess something is not set correctly or initialized when I first use the command from the lisp file, but what is it? And how is it set automatically after the first call?
Solved! Go to Solution.