mhy3sx Posted Sunday at 02:29 PM Posted Sunday at 02:29 PM (edited) I am searching for a lisp code to recognizes and dimensions LINE or ARC objects located in the Wall-2D layers and blocks in the CLOSETS-2D layer. like the image The dimension layer is DIM The idea is to pick 2 points like a line and automatic insert the dmensions. I use ZWCAD. Thanks Edited Sunday at 03:04 PM by mhy3sx Quote
BIGAL Posted Sunday at 10:32 PM Posted Sunday at 10:32 PM Yes I have something done like 40 years ago, but did you try QDIM is that in ZWCAD ? Quote
mhy3sx Posted 20 hours ago Author Posted 20 hours ago (edited) Hi BIGAL, I have try QDIM but working as Quote Select geometry to dimension : The QDIM don't dimension the block (look the image) I want to draw a line by specifying two points, to indicate where dimensions should be placed. This line should only appear on the layers named WALLS-2D and CLOSETS-2D. The WALLS-2D layer contains both lines and polylines, while the CLOSETS-2D layer contains blocks. Thanks Edited 20 hours ago by mhy3sx Quote
mhupp Posted 15 hours ago Posted 15 hours ago Drawing the line would also pick up 4 lines across the block. would maybe have to do a fence ssget. and if block draw a bounding box to pick up lines but even then could be inaccurate if not a square. 1 Quote
mhy3sx Posted 9 hours ago Author Posted 9 hours ago I find a solution. I craete a polyline ,then auto dimension the polyline and delete the polyline. Beter tahn nothing Thanks 1 Quote
BIGAL Posted 7 hours ago Posted 7 hours ago (edited) As suggested by @mhupp if you use a fence option you can find objects and get their intersection points do a sort based on start point. For the block would do a Bounding Box around the block. and get the left and right edge points, then do the dims. Yes just need a line from left to right for "intersectwith". You can set the correct layers when doing the SSGET "F". If get time will dummy up your dwg and see what the code I have does. Edited 7 hours ago by BIGAL Quote
mhupp Posted 1 hour ago Posted 1 hour ago (edited) A lot shorter then i thought. will only work on horizontal polyline. adj p3 list to affect the offset. ;;----------------------------------------------------------------------;; ;; Poly DIM acts like QDIM but allows user to select horizontal points. ;; https://www.cadtutor.net/forum/topic/99059-auto-dimension-lisp/ (defun c:PLDIM (/ ent pts p1 p2 p3 ang) (vl-load-com) (command "_.pline") (while (= 1 (getvar "cmdactive")) (command pause) ) (setq ent (entlast)) (setq pts (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget ent)))) (while (cadr pts) (setq p1 (car pts) p2 (cadr pts) mid (mapcar '/ (mapcar '+ p1 p2) '(2 2 2)) p3 (mapcar '+ mid '(0.0 2.0 0.0)) ;adj 2.0 for offset. ang (angle p1 p2) ) (command "_.DIMLINEAR" p1 p2 p3) (setq pts (cdr pts)) ) (entdel ent) (princ) ) Edited 1 hour ago by mhupp 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.