- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello, I have been trying to develop a simple LISP code to run on AutoCAD LT 2025. I originally went to chat GPT to get a solid starting point as I haven't practiced coding in a while. Since then I have been modifying the code (I thought unsuccessfully).
To give some insight on the code, it's essential function is to fill a selected rectangular outline with 4'x'8 rectangles. The outline I've been using for this is a 10'x34' rectangle. In this code, it would start in the bottom left corner and use a while loop to create vertical 4x8 rectangles, then fill in the remaining length with a skinnier 8' tall rectangle (a 2'x8' in my case). The code then essentially repeated the process for the remaining area above, except with horizontal rectangles, then finally filled in the top right hand corner.
The first part of the code was working great, but whenever it got to the remaining area on the right, it would place a 2'x10'. I could not for the life of me figure out why this was happening. Eventually simplified my code down to the initial while loop, and I just hardcoded a rectangle command with the exact coordinates for that rectangle's location, and still I got a 10' tall rectangle. So I sent this code to a coworkers computer (he was using AutoCAD 2024) and it worked. I then tried my initial code to fill in the entire area and that also worked perfect.
I've been working with an Autodesk Directly expert and he is also stumped. I sent him my AutoCAD file and he had the same issue I had, but when he recreated it in 2024 he did not. I tried it on my end with 2024 and I still had the issue. Attached is the test code I have been running. With this code, if I make my 10'x34' rectangle in the location such that the hardcoded rectangle will get placed in the correct spot, it will generate a rectangle in the right spot, but it's 2' taller than what is hardcoded in. If I move that outline somewhere else, the hardcoded rectangle will drop in exactly how it's hardcoded.
Has anyone experienced something like this?
*Update to this question*
The Autodesk Directly expert used this link to the starting file I was using. This will have the rectangle I was using. If you use this link and run the code attached, you should see the same thing I have been seeing, unless you are on 2024, then it may work?
Solved! Go to Solution.