Javier Longa Posted 11 hours ago Posted 11 hours ago Hello. I'm happy to share this routine I created with the help of Copilot, which I believe works acceptably for distributing elements (sprinklers, detectors, etc.) based on user input. I would be very grateful if any member of this forum could improve the code or offer any advice. I'm a big fan of @Lee Mac's programs, whom I consider a master. The routine will ask the user to define the measurements that define minimum and maximum values and then, by selecting a block, from which it acquires the layer and scale properties, by selecting an area, with or without "islands", it will generate a mesh pattern, which for a preliminary design is acceptable or approximate in many cases. I am Spanish and the routine is coded in Castilian Spanish (Spain). PCI_PRO (PFP).lsp 1 Quote
BIGAL Posted 44 minutes ago Posted 44 minutes ago (edited) Welome aboard. A couple of suggestions. Google translate is your friend, you can convert Spanish to English so make a English version. Code picks a control point that the grid/blocks is based off, rather than just lower left. Can do answers based on a rotated axis. may have a side on angle as control line. Hint Array & UCS The get pline points you can use this, much shorter than your code. ; thanks to Lee-mac for this get points (setq co-ord (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget ent)))) Not sure if extra block outside shape should be there shown in image Yes did something similar in the 1980's. Looks at what is outside of shape and erase. The dcl input is a good idea. Happy to discuss maybe a easier way to make sure erase all objects outside shape. Edited 42 minutes ago by BIGAL Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.