Jump to content

All Activity

This stream auto-updates

  1. Past hour
  2. Steven P

    Auto dimension lisp

    It's taken you 6 years to realise I cheat!! Good point, add (vl-load-com) in just before or after the (defun c ... line (edited above)
  3. Today
  4. I updated something that makes multiple boundaries but cant find the post right now. doesn't work with gaps so idk if its something you could use. lee mac has an outline but also don't think it works with gaps. https://lee-mac.com/outlineobjects.html
  5. mhupp

    Auto dimension lisp

    If @Steven P is going to cheat an use Lee Mac Functions! might want to add (vl-load-com) to avoid errors if they don't have it loaded since it using vlax fuctions.
  6. Hi, I am using ZWCAD. I have a problem with stretch command, I don't remember if Autocad have the same problem. I have some Templates for my drawings. The problem is when the Template include Tables , not explode tables but ACAD_TABLES when I do stretch to the template the Tables stay back don't follow the movement. I don't want to strech them just follow all the other lines. I try this but is not working. Any other ideas? (defun c:S (/ oldortho) (setq oldortho (getvar "ORTHOMODE")) (setvar "ORTHOMODE" 1) (while t (if (setq ss (ssget '((0 . "*")))) (progn (command "_.STRETCH" ss "" ) ) (progn (princ "\nΤέλος.") (setvar "ORTHOMODE" oldortho) (exit) ) ) ) ) Thanks
  7. Steven P

    Auto dimension lisp

    A slight variation on MHUPPS (vl-load-com) (defun c:ADIM (/ pt1 pt2 MyLine MySS acount MyIntersect MyDistance MyDistances pta ptb) (defun LM:intersections ( ob1 ob2 mod / lst rtn ) ;; See Lee Mac website. Get intersection list (if (and (vlax-method-applicable-p ob1 'intersectwith) (vlax-method-applicable-p ob2 'intersectwith) (setq lst (vlax-invoke ob1 'intersectwith ob2 mod)) ) (repeat (/ (length lst) 3) (setq rtn (cons (list (car lst) (cadr lst) (caddr lst)) rtn) lst (cdddr lst) ) ) ) (reverse rtn) ) (command "line" (setq pt1 (getpoint)) pause "") ; Draw reference line. Mod to polyline possible (setq MyLine (entlast)) ; Reference line entity name (setq pt2 (getvar 'lastpoint)) ; pt2 of reference line (setq MySS (ssget "_f" (list pt1 pt2) '( (-4 . "<NOT")(0 . "*DIM*") (-4 . "NOT>") ;Not Dims (-4 . "<NOT")(0 . "*TEXT*")(-4 . "NOT>") ;Not Text ))) ; Selection set crossing reference line (fence). Add filters (setq acount 0) ; a counter (while (< acount (sslength MySS)) ; Loop through selection set (if (setq MyIntersect (LM:intersections (vlax-ename->vla-object MyLine)(vlax-ename->vla-object (ssname MySS acount)) acextendnone )) ; get the intersection points, reference line, selection set items (progn (foreach n MyIntersect (setq MyDistance (distance pt1 n)) ; get the distance SS item, start reference line (setq MyDistances (cons (cons MyDistance (list n)) MyDistances)) ;; add the intersection & point to a list ) ; end foreach ) ; end progn ) ; end if intersections (setq acount (+ acount 1)) ; increase counter ) ; end while ; end loop (command "erase" MyLine "") ; erase reference line (setq MyDistances (vl-sort MyDistances (function (lambda (pta ptb) (< (car pta)(car ptB) ))) )) ; sort by distance (setq acount 0) (while (< (+ acount 1) (length MyDistances)) (setq p1 (car (cdr (nth acount MyDistances)))) (setq p2 (car (cdr (nth (+ acount 1) MyDistances)))) (setq mid (mapcar '/ (mapcar '+ p1 p2) '(2 2 2))) ; ripped of MHUPP (setq p3 (mapcar '+ mid '(0.0 2.0 0.0))) ;adj 2.0 for offset. ; ripped of MUPP (command "_.DIMLINEAR" p1 p2 p3) ; Ripped of MHUPP (setq acount (+ acount 1)) ) ; end while (princ) ) Edit: Corrected for polylines crossing reference line more than once
  8. Thanks for sharing this, really appreciate it. I gave your LISP a try on a few drawings — it works quite well on cleaner geometry, so that was helpful. In my case, I’m mostly dealing with drawings that have small gaps or slightly messy geometry, and that’s where I’m still seeing some inconsistencies with boundary creation. Your point about sharing an example makes sense — I’ll put together a sample with before/after to better explain the issue. I’ve also been experimenting with a slightly different approach for handling these kinds of cases, especially for more complex drawings. I’ll share a quick example once I clean it up a bit.
  9. Here is something simple I threw together a while ago. Not everything you want, but should help. I started a more extreme version with more options back when people were posting they couldn't get TotalBoundary and SuperBoundary any longer. I'll try to get back on it this week, in the mean time, if you could post a drawing with some before and after it would help. I have no idea what all TotalBoundary and SuperBoundary does, it may help to explain exactly how you need to select and exactly what should be a boundary in your drawing it might might it easier. Hopefully a better LISPer will jump in. ;;; Select objects that define outlines. Works on LINE/ARC/CIRCLE/SPLINE/LWPOLYLINE. ;;; ;;; https://www.cadtutor.net/forum/topic/99063-need-a-tool-for-creating-2d-outlines-for-complex-2d-drawings/#findComment-678789 ;;; ;;; By SLW210 (a.k.a. Steve Wilson) ;;; ;;; MakeOut.lsp (defun c:MakeOut (/ ss i ent lst pts plines regions pp) (vl-load-com) (if (setq ss (ssget '((0 . "LINE,ARC,CIRCLE,SPLINE,LWPOLYLINE")))) (progn (setq i 0) (while (< i (sslength ss)) (setq ent (ssname ss i)) (setq i (1+ i)) ) (command "_.-boundary" ss "") (command "_.pedit" ss "" "J" "" "Y") (setq i 0) (while (< i (sslength ss)) (setq ent (ssname ss i)) (if (= (cdr (assoc 0 (entget ent))) "LWPOLYLINE") (progn (command "_.pedit" ent "" "S" "0.01" "") (command "_.pedit" ent "" "C" "") ) ) (setq i (1+ i)) ) (princ "\nOutline created.") ) (princ "\nNo valid entities selected.") ) (princ) )
  10. mhupp

    Auto dimension lisp

    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. ) (command "_.DIMLINEAR" p1 p2 p3) (setq pts (cdr pts)) ) (entdel ent) (princ) )
  11. Hi everyone, Ankit here. I’m currently looking for a reliable solution to generate 2D outer boundaries for complex drawings in AutoCAD. The solution should be: Highly accurate (able to capture minute details) Efficient in terms of performance (handling large/complex drawings smoothly) Capable of working with imperfect geometry (small gaps, overlaps, etc.) I’ve used tools like TotalBoundary earlier, but since it’s no longer purchasable/accessible, I’m exploring alternatives. Does anyone know of any plugin, LISP, or workflow that can achieve similar or better results? Any recommendations would be really helpful. Thanks in advance!
  12. Yesterday
  13. BIGAL

    Auto dimension lisp

    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.
  14. mhy3sx

    Auto dimension lisp

    I find a solution. I craete a polyline ,then auto dimension the polyline and delete the polyline. Beter tahn nothing Thanks
  15. You are starting from the benchmark are you not? To create lines by bearing and distance enter the LINE command, pick a start point, let go of your mouse and at the command prompt type in the @ symbol first followed by the distance and the bearing. Example: @50.00'<N80d04'30"E. By the way, I suggest you ask your questions in the thread I mentioned to you yesterday in our private message exchange. Please do not start a new thread. Thank you.
  16. mhupp

    Auto dimension lisp

    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.
  17. That may be part of it, but I think some of it has to do with the answers to many inquiries is available without a login, and yes AI sometimes gives that in the answer to a search. Any search I do with the search engine (DuckDuckGo) gives an AI response at the top, or supposedly a summary of the results, the AI results can be inaccurate to say the least. I do see some posting on this and other forums for correct answers after the AI sends them down the wrong road. I seldom login to AUGI and Autodesk Forums, Autodesk rearranges their forum so much many links, some not even very old, go to a dead end now.
  18. SLW210

    TotalBoundary • Outline creation tool

    As I mentioned already, you need to start a new thread in the AutoLISP, Visual LISP & DCL Forum.
  19. Ankit Pandit

    HIPPED ROOF ROUTINES

    Thank you for the plugin it worked well
  20. mhy3sx

    Auto dimension lisp

    Hi BIGAL, I have try QDIM but working as 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
  21. Ankit Pandit

    TotalBoundary • Outline creation tool

    Hello, Anyone knows any tool or CAD plugin that extracts 2D boundary for drawings? i tried the total boundary but my trail period is over and I am not able to purchase the total boundary please help me find a tool
  22. Last week
  23. BIGAL

    Auto dimension lisp

    Yes I have something done like 40 years ago, but did you try QDIM is that in ZWCAD ?
  24. 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
  25. I am having issues with the beginning steps of the final project. I have been prompted to enter survey data, but every time i press enter to place the line down, it will just put a line down at where my cursor is.
  26. This is sad news and a little concerning that no explanation is being given. On the face of it, it looks like a complete disregard for the community - I hope that's not true. What is true is that community engagement on forums like this has declined in recent years. Some of that decline is a result of AI. I know that this site has been scraped by LLM bots and, as a result, people seeking answers don't need to visit the site if an AI agent can provide the answer. Just to let you know, I have no intention of closing or suspending this forum any time soon.
  27. Tired to squeeze three lines into one from lee's code converted it back.
  28. Did crash upon: 'repeat.. changed my working 'C2 with the while cmdecho. Thanks -- Actually nice but the osnaps don't work with grrrr, the crash was from 'ctan:res var being unfilled (40..) true, an interesting alternate. Thanks mhupp.
  29. Thanks, I'll try it. There is another option, but it does not work for all formats. ;; A3x3 (420x891) ((and (<= SideS 425) (<= SideL 896)) (vla-put-CanonicalMediaName Layout "UserDefinedMetric (891.00 x 420.00мм)"))
  1. Load more activity
×
×
  • Create New...