+ Reply to Thread
Page 2 of 2 FirstFirst 1 2
Results 11 to 15 of 15
  1. #11
    Quantum Mechanic BIGAL's Avatar
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    10,709

    Default

    Registered forum members do not see this ad.

    Rlx is it 1 dwg per sheet as well ?
    A man who never made mistakes never made anything

  2. #12
    Super Member rlx's Avatar
    Computer Details
    rlx's Computer Details
    Operating System:
    W10
    Computer:
    i74ghz/ssd500/2tbhdd
    Discipline
    Electrical
    rlx's Discipline Details
    Occupation
    electrical designer dragon
    Discipline
    Electrical
    Details
    I dont excel in anything but I rearly give up
    Using
    AutoCAD 2016
    Join Date
    Nov 2014
    Location
    Bergen op Zoom , Netherlands
    Posts
    1,058

    Default

    Quote Originally Posted by BIGAL View Post
    Rlx is it 1 dwg per sheet as well ?
    sadly but yes....

  3. #13
    Forum Newbie
    Discipline
    Mechanical
    Using
    AutoCAD 2014
    Join Date
    Jul 2018
    Posts
    6

    Default


  4. #14
    Super Member rlx's Avatar
    Computer Details
    rlx's Computer Details
    Operating System:
    W10
    Computer:
    i74ghz/ssd500/2tbhdd
    Discipline
    Electrical
    rlx's Discipline Details
    Occupation
    electrical designer dragon
    Discipline
    Electrical
    Details
    I dont excel in anything but I rearly give up
    Using
    AutoCAD 2016
    Join Date
    Nov 2014
    Location
    Bergen op Zoom , Netherlands
    Posts
    1,058

    Default

    just some lunch fun to get you started. Kept it as simple as possible. All could be done by dialog and / or automatically show all filenames in your template folder etc. Wanted to post earlier but major W10 update stopped me from doing anything for 3-4 hours.


    Code:
    (defun c:Captain_Ahap  ( / SizeList ScaleList size scale titleblockfolder titleblock)
      (vl-load-com)
      ; some shortcuts for titleblock / border sizes (without the full path)
      (setq SizeList  (list "A0" "A1" "A2" "A3" "A4-L" "A4-P")
     ScaleList (list 1 10 50 100)
     titleblockfolder "c:/temp/mytitleblockfolder/"
      )
      (if (and (setq size  (CycleList "Choose titleblock size" SizeList))
        (setq scale (CycleList "Choose titleblock scale" ScaleList)))
        (progn
          ; maybe translate size to filename first
          (cond ((eq size   "A0") (setq titleblock (strcat titleblockfolder "A0_horizondal_test.dwg")))
         ((eq size   "A1") (setq titleblock (strcat titleblockfolder "A1_horizondal_test.dwg")))
         ((eq size   "A2") (setq titleblock (strcat titleblockfolder "A2_horizondal_test.dwg")))
         ((eq size   "A3") (setq titleblock (strcat titleblockfolder "A3_horizondal_test.dwg")))
         ((eq size "A4-L") (setq titleblock (strcat titleblockfolder "A4_Landscape_test.dwg")))
         ((eq size "A4-P") (setq titleblock (strcat titleblockfolder "A4_Portrait_test.dwg")))
          )
          (if (and titleblock (findfile titleblock) (numberp scale))
     (progn
       (setvar 'expert 2) (setvar 'cmdecho 0) (setvar 'attreq 0)
       (command "-insert" titleblock (list 0 0 0) scale scale 0)
       (command "_.explode" "_L")
       (command "-purge" "B" "YourBlockName" "N")
       (command "._zoom" "e")
     )
     (alert "Unable to insert titleblock")
          )
        )
      )
      (princ)
    )
    
    ; example1 (setq choise (CycleList "Choose titleblock size" '("A0" "A1" "A2" "A3" "A4")))
    ; example2 (setq choise (CycleList "Choose titleblock scale" '(1 10 50 100)))
    (defun CycleList (msg lst / inp loop rtn)
      (setq loop t)
      (while loop
        (princ "\nCycle list with tab or L-mouse / accept use enter,space or R-mouse / Esc or x for exit\n")
        (princ (strcat "\r" msg " <" (vl-princ-to-string (car lst)) "> : "))
        (setq inp (vl-catch-all-apply 'grread (list nil 8 0)))
        (if (vl-catch-all-error-p inp)
          (progn (princ "\nTitleblock insertion cancelled")(setq rtn nil loop nil))
          (progn
            (cond
              ;tab
              ((or (equal inp '(2 9))(= (car inp) 3))
               (setq lst (append (cdr lst)(list (car lst))))
               (princ (strcat "\r" msg " <" (vl-princ-to-string (car lst)) "> : ")))
              ;enter,space,r-mouse
              ((or (equal inp '(2 13)) (equal inp '(2 32))(= (car inp) 25))
               (setq rtn (car lst) loop nil))
              ;x or X
              ((member inp '((2 88)(2 120)))(setq rtn nil loop nil))
            )
          )
        )
      )
      (terpri)
      rtn
    )
    ; start command with (c:Captain_Ahap)
    well , (work)day is done , so I'm gone ... with the wind (or the waves since you're obviously have a fishy thing ;-)


    gr. Rlx

  5. #15
    Forum Newbie
    Discipline
    Mechanical
    Using
    AutoCAD 2014
    Join Date
    Jul 2018
    Posts
    6

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by rlx View Post
    just some lunch fun to get you started. Kept it as simple as possible. All could be done by dialog and / or automatically show all filenames in your template folder etc. Wanted to post earlier but major W10 update stopped me from doing anything for 3-4 hours.


    Code:
    (defun c:Captain_Ahap  ( / SizeList ScaleList size scale titleblockfolder titleblock)
      (vl-load-com)
      ; some shortcuts for titleblock / border sizes (without the full path)
      (setq SizeList  (list "A0" "A1" "A2" "A3" "A4-L" "A4-P")
     ScaleList (list 1 10 50 100)
     titleblockfolder "c:/temp/mytitleblockfolder/"
      )
      (if (and (setq size  (CycleList "Choose titleblock size" SizeList))
        (setq scale (CycleList "Choose titleblock scale" ScaleList)))
        (progn
          ; maybe translate size to filename first
          (cond ((eq size   "A0") (setq titleblock (strcat titleblockfolder "A0_horizondal_test.dwg")))
         ((eq size   "A1") (setq titleblock (strcat titleblockfolder "A1_horizondal_test.dwg")))
         ((eq size   "A2") (setq titleblock (strcat titleblockfolder "A2_horizondal_test.dwg")))
         ((eq size   "A3") (setq titleblock (strcat titleblockfolder "A3_horizondal_test.dwg")))
         ((eq size "A4-L") (setq titleblock (strcat titleblockfolder "A4_Landscape_test.dwg")))
         ((eq size "A4-P") (setq titleblock (strcat titleblockfolder "A4_Portrait_test.dwg")))
          )
          (if (and titleblock (findfile titleblock) (numberp scale))
     (progn
       (setvar 'expert 2) (setvar 'cmdecho 0) (setvar 'attreq 0)
       (command "-insert" titleblock (list 0 0 0) scale scale 0)
       (command "_.explode" "_L")
       (command "-purge" "B" "YourBlockName" "N")
       (command "._zoom" "e")
     )
     (alert "Unable to insert titleblock")
          )
        )
      )
      (princ)
    )
    
    ; example1 (setq choise (CycleList "Choose titleblock size" '("A0" "A1" "A2" "A3" "A4")))
    ; example2 (setq choise (CycleList "Choose titleblock scale" '(1 10 50 100)))
    (defun CycleList (msg lst / inp loop rtn)
      (setq loop t)
      (while loop
        (princ "\nCycle list with tab or L-mouse / accept use enter,space or R-mouse / Esc or x for exit\n")
        (princ (strcat "\r" msg " <" (vl-princ-to-string (car lst)) "> : "))
        (setq inp (vl-catch-all-apply 'grread (list nil 8 0)))
        (if (vl-catch-all-error-p inp)
          (progn (princ "\nTitleblock insertion cancelled")(setq rtn nil loop nil))
          (progn
            (cond
              ;tab
              ((or (equal inp '(2 9))(= (car inp) 3))
               (setq lst (append (cdr lst)(list (car lst))))
               (princ (strcat "\r" msg " <" (vl-princ-to-string (car lst)) "> : ")))
              ;enter,space,r-mouse
              ((or (equal inp '(2 13)) (equal inp '(2 32))(= (car inp) 25))
               (setq rtn (car lst) loop nil))
              ;x or X
              ((member inp '((2 88)(2 120)))(setq rtn nil loop nil))
            )
          )
        )
      )
      (terpri)
      rtn
    )
    ; start command with (c:Captain_Ahap)
    well , (work)day is done , so I'm gone ... with the wind (or the waves since you're obviously have a fishy thing ;-)


    gr. Rlx
    Thank you rlx.It works nice. will be using the 'support' folder in c instead of temp.

Similar Threads

  1. Block creation help
    By JamFam in forum AutoCAD 2D Drafting, Object Properties & Interface
    Replies: 5
    Last Post: 23rd Jul 2013, 07:41 am
  2. link title of file to the title block inside
    By 19cruthik68 in forum AutoCAD Drawing Management & Output
    Replies: 4
    Last Post: 12th Jun 2012, 09:25 am
  3. Macro for Block Creation
    By nfractals in forum AutoLISP, Visual LISP & DCL
    Replies: 5
    Last Post: 5th Jun 2012, 04:04 am
  4. Block Creation
    By swfla08 in forum AutoCAD General
    Replies: 6
    Last Post: 13th May 2008, 12:30 am
  5. Dynamic Block Creation
    By Gary_W in forum AutoCAD Drawing Management & Output
    Replies: 6
    Last Post: 23rd Mar 2007, 02:12 pm

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts