Jump to content

Leaderboard

  1. pkenewell

    pkenewell

    Community Member


    • Points

      4

    • Posts

      775


  2. mhupp

    mhupp

    Trusted Member


    • Points

      3

    • Posts

      2,172


  3. Tsuky

    Tsuky

    Community Member


    • Points

      2

    • Posts

      336


  4. mhy3sx

    mhy3sx

    Community Member


    • Points

      1

    • Posts

      302


Popular Content

Showing content with the highest reputation since 03/18/2026 in all areas

  1. @pmadhwal7 Looks like you had this same problem in 2019. MLEADERS were suggested to you then and you didn't try the tools offered? I did the following with a LEADER to MLEADER conversion very quickly:
    2 points
  2. 100% setenv is writing strings to your windows registry. not good if you are doing that for all variables. might want to check to see what else you have been writing there. HKEY_CURRENT_USER\Software\Autodesk\AutoCAD\R##.#\ACAD-####:###\Profiles\<<Unnamed Profile>>\Variables tho setenv will persist even after reboot. overkill for most variables need in lisp. like @pkenewell said you should be good with just global variables. that holds while the drawing is open but make them unique. if you need to hold a variable in the drawing itself. use ldata that will persist in the drawing. so you can close and reopen it.
    2 points
  3. Or using the method proposed by @Stefan BMR we could automate in lisp like this: (enter the distances when the cursor is on the tracking line to get the desired angles) (defun des_vec (lst col / lst_sg) (setq lst_sg (list (cadr lst) (car lst))) (setq lst (cdr lst)) (while lst (if (cadr lst) (setq lst_sg (cons (cadr lst) (cons (car lst) lst_sg))) ) (setq lst (cdr lst)) ) (setq lst_sg (cons col lst_sg)) (grvecs lst_sg) ) (defun c:pl90-45 ( / old_set p1 p2 lst_pt msg) (setq old_set (mapcar 'getvar '("GRIDMODE" "ANGDIR" "ANGBASE" "POLARANG" "POLARMODE" "AUTOSNAP" "SNAPANG" "ORTHOMODE"))) (initget 33) (setq p1 (getpoint "\nPick start point: ")) (initget 33) (setq p2 (getpoint p1 "\nReference start angle: ") lst_pt (list (list (car p1) (cadr p1))) msg "\nGive distanve in the direction of cursor: " ) (mapcar 'setvar '("GRIDMODE" "ANGDIR" "ANGBASE" "POLARANG" "POLARMODE" "AUTOSNAP" "SNAPANG" "ORTHOMODE") (list 0 0 (angle p1 p2) (* 0.25 pi) 3 2 (angle p1 p2) 1) ) (initget 303) (while (and (setq p2 (getpoint p1 msg)) (/= p2 "C")) (cond ((/= p2 "U") (setq p2 (list (car p2) (cadr p2))) (mapcar 'setvar '("AUTOSNAP" "SNAPANG" "ORTHOMODE") (list 10 (angle p1 p2) 0) ) (setq p1 p2 lst_pt (cons p2 lst_pt) msg "\nGive distanve in the direction of cursor or [C/U] for Close or Undo : " ) ) (T (setq lst_pt (cdr lst_pt) p1 (car lst_pt) ) ) ) (redraw) (des_vec lst_pt 7) (initget 302 "C U") ) (entmake (append (list '(0 . "LWPOLYLINE") '(100 . "AcDbEntity") (cons 8 (getvar "CLAYER")) '(100 . "AcDbPolyline") (cons 90 (length lst_pt)) (if (= p2 "C") '(70 . 1) '(70 . 0)) ) (mapcar '(lambda (x) (cons 10 x)) lst_pt) ) ) (mapcar 'setvar '("GRIDMODE" "ANGDIR" "ANGBASE" "POLARANG" "POLARMODE" "AUTOSNAP" "SNAPANG" "ORTHOMODE") old_set) (prin1) )
    2 points
  4. Hi everyone, I want to share a LISP tool I recently developed called SyncBlock. If you work with architectural or MEP backgrounds, you probably deal with this nightmare constantly: You have a Master Block (A), and several child blocks (B, C, D) that were copied from A but have some layers deleted to show different details. When the Master Block updates, synchronizing those child blocks without ruining their specific layer visibility—and without them flying off to random coordinates because their base points are all set to (0,0,0)—is a huge pain. To solve this, I wrote a script that does the following: 1. You select the Master Block. 2. You window-select the target blocks. 3. The script reads which layers are currently active in the target block, clears it, and pulls only those matching layers from the Master Block. The Magic (Consensus Voting Algorithm): The biggest challenge was alignment. Standard Bounding Box methods fail if you delete half a room or add a dimension in the child block. To fix this, the script uses a "Consensus Voting" approach. It gathers all valid geometry centers in both blocks, pairs them up, calculates the displacement vectors (dX, dY), and lets them "vote." The offset with the overwhelming majority wins. This ensures pixel-perfect alignment even if the child block is heavily trimmed! GitHub Repository: https://github.com/beastt1992/SyncBlock-AutoCAD The code avoids copying Hatches to prevent associativity crashes, and it safely handles older AutoCAD versions (like 2014) by using pure English prompts to avoid ANSI/UTF-8 encoding issues. I’d love for you guys to test it out on your messy real-world drawings! Any feedback, bug reports, or suggestions for improvement are highly appreciated. Cheers!
    1 point
  5. At one time P-F required students to submit a separate .dwg file for each plate. I don't see any reason why you can't use layouts. Your advisor could probably answer the question.
    1 point
  6. Welcome to Cadtutor. What you are offering is not a new solutions this have been around for me say 17 years, for where I worked. But I have something extra for you, once you make the PDF's as single pdf's you can join them back into one, done this for 88 layouts but code looks for PDF's. It uses Ghostscript to rejoin the pdf's. Ghostscript is a free product and has lots of features. The code is ran via lisp. The code attached also allows for a selection of layouts it has the Ghostscript code in it. You will need to edit the version of Ghostscript and its location. A more advanced version checks for different company title blocks, eg landscape V's portrait. Like others I would push for using layouts a much better way as you can take advantage of the viewport scale, I have multi code for making multiple layouts at scale matching your model space. Multi GETVALS.lsp plotA3Pdfrange2.lsp
    1 point
  7. So post the LISP so we can give feedback - it is easier to reference if the LISP is in the same thread as the comments and questions Though I might be tempted to say change the system and get the draughters to use paperspace for what it is meant for. (haven't had the paperspace / modespace discussion on here for a while now....)
    1 point
  8. Ok, I fix it. Thanks
    1 point
  9. Yes - That's it! I looked at the drawing again, and the z dim was off by a very small amount! when I set z to zero on the entities - QLATTACH works.
    1 point
  10. I wonder if their is a Z difference that those commands error. many a "2D" Drawing iv been given has stuff like 100' above everything else.
    1 point
  11. @ScottMC I don't see the purpose of why you are cutting the circle, printing the coordinates to the command line, then pasting the circle in the same loop? - You don't need to initialize the pp variable as "" - There is not apparent reason to cut and paste the circle. - You do not need to put a Global variable into the registry to recall it again in the same session, even if the program stops. Try out the following code: (defun c:C2 (/ cr el *error* fp oe os p p2) (defun *error* (msg) (if oe (setvar "cmdecho" oe)) (if os (setvar "osmode" os)) (vla-endundomark (vla-get-activedocument (vlax-get-acad-object))) (princ (strcat "\n" msg)) ) (vla-startundomark (vla-get-activedocument (vlax-get-acad-object))) (setq oe (getvar "cmdecho") os (getvar "osmode") ) (setvar "cmdecho" 0) (while (and (setvar 'osmode (boole 7 os 512)) (setq fp (getpoint "\nSpecify 1st Point of 2P.Circle: ")) ) (command "._Circle" "_2P" "_non" fp) (setvar "osmode" OS) (princ "\nSecond Point: ") (while (= (logand (getvar "cmdactive") 1) 1) (command pause) ) (setq el (entget (entlast)) p (trans (cdr (assoc 10 el)) (cdr (assoc 210 el)) 1) p2 (getvar "lastpoint") cr (getvar "circlerad") ) (princ (strcat "\n Coordinates: " (setq C2:pp ;; Global Variable "C2:pp" (strcat (rtos (car p) 2 4) "," (rtos (cadr p) 2 4) "," (rtos (caddr p) 2 4) ) ) "\n Diameter: " (rtos (* cr 2) 2 4) "| Radius: " (rtos cr 2 4) "\n" ) ) (entmakex (list (cons 0 "POINT") (cons 10 p))) (entmakex (list (cons 0 "POINT") (cons 10 p2))) ) (setvar "cmdecho" oe) (vla-endundomark (vla-get-activedocument (vlax-get-acad-object))) (princ) )
    1 point
  12. If I understand correctly your request, I think you can get the same with the right settings. Just aim the desired direction and specify the distance.
    1 point
  13. Alright, another Penn Foster student here. Big shocker there, I know. I put all my drawings from model space in to sheets but I lost all my dimensions and some of my furniture blocks. I double checked to be sure I didn't have any frozen layers, nothing is in def points, they're in correct layers, I ran an audit and it found and fixed 0 errors. I'm really new to all this auto cad stuff but apparently my work thinks I need it even though ill never use it. I'm not even ALOUD to have it on my computer at work...lol Any help would be greatly appreciated Flr-B.dwg Flr-1.dwg FLR-2.dwg
    1 point
  14. THIS CODE CONVERTING LEADER TO MLEADER AND I DIN'T REQUIRED MLEADER
    0 points
×
×
  • Create New...