Jump to content

Recommended Posts

Posted (edited)

Hello Everybody

Can you please help me insert the next and previous button feature for the image cells of this program

 

Thank  for all

;;¨Ï¥ÎªÌBLOCK¹Ï®wºÞ²z v2.0
;;for AutoCAD 2013 ¤¤¤åª©¤§ AutoLISP
;; 2013/12/26
;;½s¼¶¡G«\¶³ó}

;;v1.1 §K¦w¸Ë DOSLib.arx
;;v1.2 ¼W¥[[·j´M]¥\¯à
;;v1.3 ¼W¥[[§R°£ÀÉ®×]&[§ó§ïÀɦW]¥\¯à&§ó§ï[Browse]
;;v1.4 ¼W¥[[§ó·s¤Û¿O¤ù]¥\¯à
;;v1.5 ¼W¥[[¦^¹Ï®w]¥\¯à
;;v1.6 ¼W¥[¦h­«½Æ»s¥\¯à
;;v2.0 ¼W¥[[·s¼W¥Ø¿ý]&[§R°£¥Ø¿ý]&[§ó§ï¥Ø¿ý]¥\¯à¡A­×§ï[·s¼WÀÉ®×]¹ï¸Ü®Ø
;;     ¼W¥[[²Ä¤@­¶]&[³Ì¥½­¶]&[¤W¤@­¶]&[¤U¤@­¶]¥\¯à
;;     µ²¦X y340.dcl »P Y340.LSP ¬°¤@­ÓÀÉ®×

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;                                                                        ;;
;; ======  µ{¦¡¨Ï¥Î»¡©ú¡G ======                                          ;;
;;                                                                        ;;
;; 01.¶i¤J AutoCAD 2013 ¤¤¤åª©Àô¹Ò¤¤¡A¨Ì¤U¦C¨BÆJ¶i¦æ³]©w¡A                ;;
;;    ©ó  \¤u¨ã(T)\¿ï¶µ(N) ¹ï¸Ü®Ø¡A                                       ;;
;;    ÀÉ®×\¤ä´©ÀÉ·j´M¸ô®|\ ¤¤¥[¤J¤U¦C¦U¶µ                                 ;;
;;    D:\ACADUser\ (¨Ì¨Ï¥ÎªÌBLOCK¹ÏÀɦs©ñ¸ô®|³]©w)                        ;;
;;                                                                        ;;
;; 02.¨C­Ó¥Ø¿ý¤¤¦Ü¤Ö­n¦³¤@­ÓBLOCK(.dwg)¹ÏÀÉ¡A§_«hµ{¦¡±NµLªk°õ¦æ¡C         ;;
;;    ¥Ø¿ý¤]¶È®e³\25­ÓBLOCK(.dwg)¹ÏÀÉ¡A¤£µMµ{¦¡¤]±NÃö³¬Â÷¶}¡C             ;;
;;    ©Ò¦³ÀÉ®×»P¥Ø¿ý³£¤£»Ý­n­«·s§ó§ï¦WºÙ´N¥i¨Ï¥Î.                         ;;
;;                                                                        ;;
;; 03.[·s¼W BLOCK] ¨Ï¥ÎªÌ¿ï¨ú¥Ø¿ý«á¡A¿é¤JÀɮצWºÙ¡A´N¥i·s¼WBLOCK(.dwg)    ;;
;;    ¹ÏÀÉ©M¤Û¿O¤ù(.sld)ÀɮסA¤£¥Î¥t¥~°õ¦æ WBLOCK ©M MSLIDE «ü¥O.         ;;
;;                                                                        ;;
;; 04.[¦Û°Ê°õ¦æ] ¿ï¨úª«¥ó¡B¿é¤J´¡¤JÂI¡A¦Û°Ê§¹¦¨ Block ©M Slide Àɮ׫إߡA ;;
;;    §Ö³t«K±¶¡C¤]¥i¥H¤À§O°õ¦æ·s¼WBLOCK(.dwg)¹ÏÀɩηs¼W¤Û¿O¤ù(.sld)ÀÉ®×.  ;;
;;    µ{¦¡¤¤¹w¯d·|¦Û°Ê¿ï¨úª«¥ó¤¤¤ßÂI¬°´¡¤J°ò·ÇÂIªº¿ï¶µ¡A¤è«K§ó§ï.         ;;
;;                                                                        ;;
;; 05.[§ó´«¦Ü²Ä0¼h] ±N¿ï¨úª«¥ó¥H²Ä0¼h»s§@BLOCK(.dwg)¹ÏÀɩΤۿO¤ù(.sld)    ;;
;;    ÀɮסA¹Ï­±¤W­ìª«¥ó¹Ï¼hºû«ù¤£ÅÜ.                                     ;;
;;                                                                        ;;
;; 06.[¤j¹Ï¹wÄý] ¨Ï¥ÎªÌ¤£¥Î¸ü¤J BLOCK¡A´N¯à¬Ý²M·¡¹ÏÀɤº®e¡A               ;;
;;    Åý BLOCK ¤£¤î¯àÀx¦s´¡¹Ï¡A¤]¥i¥H±N¾ã±i¹ÏÂkÀɺ޲z¡A                   ;;
;;    ÂÇ¥Ñ[¤j¹Ï¹wÄý]¥\¯à¡A¤£¥Î¦A¥t¥~¶}±Ò¬Ý¹Ïµ{¦¡¡A¤ñ"³]­p¤¤¤ß"¦n¥Î.       ;;
;;    ­Y±N©Ò¦³ªº¹ÏÀÉÀx¦s¦b¤@­Ó¥Ø¿ý¤¤ºÞ²z¡A²³æ¨S·Ð´o.                     ;;
;;                                                                        ;;
;; 07.[¹Ï¼h] ¨Ï¥ÎªÌ¿ï¨úBLOCK«áø¥Xªº¹Ï¼h¡A¦P®ÉÅã¥Ü¹Ï¼h¹Ï¥Ü¡A¤£·|¿ï¿ù.     ;;
;;                                                                        ;;
;; 08.[¤ñ¨Ò] ¹w³] 4ºØÃ¸¹Ï¤ñ¨Ò¨Ñ¿ï¥Î¡A¤º§t"­^¦TÂऽ¤À"¡B"¦Û­q"µ¥¿ï¶µ.      ;;
;;                                                                        ;;
;; 09.[¦h­«½Æ»s] ´¡¤JBLOCK«á¥iø¥X¬Û¦PBLOCK¦h­Ó.                          ;;
;;                                                                        ;;
;; 10.[¤À¸Ñ] «ü©wBLOCK«á¡Aø¥X®É´N¤w¸g°õ¦æ EXPLODE (¤À¸Ñ)«ü¥O.            ;;
;;                                                                        ;;
;; 11.[ÂsÄý] °£¤F«ü©w¥Ø¿ý¥~¡A¤]¥i¥H´¡¤J©Î·s¼W¦b¥L³BªºBLOCK(.dwg)¹ÏÀÉ.     ;;
;;                                                                        ;;
;; 12.[·s¼W¥Ø¿ý]&[§R°£¥Ø¿ý]&[§ó§ï¥Ø¿ý] ¥Ø¿ýºÞ²z¥\¯à.                      ;;
;;                                                                        ;;
;; 13.[·s¼WÀÉ®×]&[§R°£ÀÉ®×]&[§ó§ïÀɦW] Àɮ׺޲z¥\¯à.                      ;;
;;                                                                        ;;
;; 14.[²Ä¤@­¶]&[³Ì¥½­¶]&[¤W¤@­¶]&[¤U¤@­¶] ¥Ø¿ý´«­¶¥\¯à.                   ;; 
;;                                                                        ;;
;; 15.[§ó·s¤Û¿O¤ù] ±N«ü©w¥Ø¿ý¤U©Ò¦³¹ÏÀɳ£¦Û°Ê­«·s«Ø¥ß(.sld)¤Û¿O¤ù¡A       ;;
;;    ·|Âл\­ì¦³(.sld)¤Û¿O¤ùÀɮסA­ì¦³BLOCK(.dwg)Àɮפ£·|§ó§ï¡A           ;;
;;    ¹ÏÀɦWºÙ¤£¯à¦³"(" ")"²Å¸¹.                                          ;;
;;                                                                        ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defun C:Y340 (/ scm shig slay sos sfid scopy *ERROR* dirdwg dcl_id)
    (setq scm   (getvar "cmdecho"))
    (setq shig  (getvar "highlight"))
    (setq slay  (getvar "clayer"))
    (setq sos   (getvar "osmode"))
    (setq sfid  (getvar "filedia"))
    (setq scopy (getvar "copymode"))
        (setvar "cmdecho"   0)
        (setvar "highlight" 1)
        (setvar "filedia"   1) ;; Åã¥Ü¹ï¸Ü¤è¶ô
        (setvar "copymode"  1) ;; ¦h­«½Æ»s

    (defun *ERROR* (msg)
        ;;(:Ys+var:)
        (setvar "clayer" "0")
        (setvar "celtype" "ByLayer")
        (setvar "textstyle" "Standard")
        (if dcl_id (unload_dialog dcl_id))
        (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")
            (princ (strcat "\n*** Error: " msg " ***")))
    (princ) )

    (vl-load-com)
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;  ³]©wBLOCK¹ÏÀɦs©ñ¸ô®|(¨Ï¥ÎªÌ¥i¦Û¦æ­×§ï " " ¤ºªº¸ô®|)  >>>>>>

    (setq :Y340_DWG: "D:/ACADUser/")

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    (:Y340-1:)
    (if dirdwg (:Y340-11:)) ;; ¦^´_ªì©l­È³]©w
    (command "._REDRAW")
    (princ "\n****** End!  µ²§ô! ******")

    (setvar "cmdecho"   scm)
    (setvar "highlight" shig)
    (setvar "clayer"    slay)
    (setvar "osmode"    sos)
    (setvar "filedia"   sfid)
    (setvar "copymode"  scopy)
(princ)
)
(prompt "\n****** Load << ¨Ï¥ÎªÌBLOCK¹Ï®wºÞ²z v2.0 >> Successful ******")
(prin1)



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;  ³]©w DCL  >>>>>>

(defun :load_dcl_Y340: (/ dcl_file tmp)
    (not (and (setq dcl_file (open (setq tmp (vl-filename-mktemp nil nil ".DCL")) "w"))
              (progn
                  (foreach x
                      '(
                        "Y340 : dialog {"
                        "  label = \"  ¨Ï¥ÎªÌBLOCK¹Ï®wºÞ²z v2.0\";"
                        "  : row {"
                        "    : button {label= \"¦^¹Ï®w\";  key= \"go_y340\"; fixed_width= true;}"
                        "    : button {label= \"&Browse\"; key= \"browse1\"; fixed_width= true;}"
                        "    : text   {width = 60; key= \"bpath1\";}"
                        "    : text   {width = 30; key= \"bfile\";}"
                        "    : button {"
                        "      label       = \"¤j¹Ï¹wÄý  &X\";"
                        "      key         = \"brow\";"
                        "      height      = 3;"
                        "      width       = 25;"
                        "      fixed_width = true;"
                        "      alignment   = right;"
                        "    }"
                        "  }"
                        "  : row {"
                        "    : column {"
                        "      : list_box {"
                        "        key    = \"list-1\";"
                        "        height = 18;"
                        "        width  = 20;"
                        "      }"
                        "      : row {"
                        "        : button {label= \"·s¼W\"; key= \"a_dir\";}"
                        "        : button {label= \"§R°£\"; key= \"d_dir\";}"
                        "        : button {label= \"§ó§ï\"; key= \"r_dir\";}"
                        "      }"
                        "      : text     {label= \"BLOCK ¹ÏÀÉ >>>>>>\";}"
                        "      : list_box {"
                        "        key    = \"list-2\";"
                        "        height = 22;"
                        "        width  = 20;"
                        "      }"
                        "      : row {"
                        "        : button {label= \"·s¼W\"; key= \"a_file\";}"
                        "        : button {label= \"§R°£\"; key= \"d_file\";}"
                        "        : button {label= \"§ó§ï\"; key= \"r_file\";}"
                        "      }"
                        "    }"
                        "    : column {"
                        "      : row {"
                        "        : image_button {"
                        "          key          = \"im1\";"
                        "          aspect_ratio = 1.42;"
                        "          height       = 7.5;"
                        "          color        = -2;"
                        "          allow_accept = true;"
                        "        }"
                        "        : image_button {"
                        "          key          = \"im2\";"
                        "          aspect_ratio = 1.42;"
                        "          height       = 7.5;"
                        "          color        = -2;"
                        "          allow_accept = true;"
                        "        }"
                        "        : image_button {"
                        "          key          = \"im3\";"
                        "          aspect_ratio = 1.42;"
                        "          height       = 7.5;"
                        "          color        = -2;"
                        "          allow_accept = true;"
                        "        }"
                        "        : image_button {"
                        "          key          = \"im4\";"
                        "          aspect_ratio = 1.42;"
                        "          height       = 7.5;"
                        "          color        = -2;"
                        "          allow_accept = true;"
                        "        }"
                        "        : image_button {"
                        "          key          = \"im5\";"
                        "          aspect_ratio = 1.42;"
                        "          height       = 7.5;"
                        "          color        = -2;"
                        "          allow_accept = true;"
                        "        }"
                        "      }"
                        "      : row {"
                        "        : image_button {"
                        "          key          = \"im6\";"
                        "          aspect_ratio = 1.42;"
                        "          height       = 7.5;"
                        "          color        = -2;"
                        "          allow_accept = true;"
                        "        }"
                        "        : image_button {"
                        "          key          = \"im7\";"
                        "          aspect_ratio = 1.42;"
                        "          height       = 7.5;"
                        "          color        = -2;"
                        "          allow_accept = true;"
                        "        }"
                        "        : image_button {"
                        "          key          = \"im8\";"
                        "          aspect_ratio = 1.42;"
                        "          height       = 7.5;"
                        "          color        = -2;"
                        "          allow_accept = true;"
                        "        }"
                        "        : image_button {"
                        "          key          = \"im9\";"
                        "          aspect_ratio = 1.42;"
                        "          height       = 7.5;"
                        "          color        = -2;"
                        "          allow_accept = true;"
                        "        }"
                        "        : image_button {"
                        "          key          = \"im10\";"
                        "          aspect_ratio = 1.42;"
                        "          height       = 7.5;"
                        "          color        = -2;"
                        "          allow_accept = true;"
                        "        }"
                        "      }"
                        "      : row {"
                        "        : image_button {"
                        "          key          = \"im11\";"
                        "          aspect_ratio = 1.42;"
                        "          height       = 7.5;"
                        "          color        = -2;"
                        "          allow_accept = true;"
                        "        }"
                        "        : image_button {"
                        "          key          = \"im12\";"
                        "          aspect_ratio = 1.42;"
                        "          height       = 7.5;"
                        "          color        = -2;"
                        "          allow_accept = true;"
                        "        }"
                        "        : image_button {"
                        "          key          = \"im13\";"
                        "          aspect_ratio = 1.42;"
                        "          height       = 7.5;"
                        "          color        = -2;"
                        "          allow_accept = true;"
                        "        }"
                        "        : image_button {"
                        "          key          = \"im14\";"
                        "          aspect_ratio = 1.42;"
                        "          height       = 7.5;"
                        "          color        = -2;"
                        "          allow_accept = true;"
                        "        }"
                        "        : image_button {"
                        "          key          = \"im15\";"
                        "          aspect_ratio = 1.42;"
                        "          height       = 7.5;"
                        "          color        = -2;"
                        "          allow_accept = true;"
                        "        }"
                        "      }"
                        "      : row {"
                        "        : image_button {"
                        "          key          = \"im16\";"
                        "          aspect_ratio = 1.42;"
                        "          height       = 7.5;"
                        "          color        = -2;"
                        "          allow_accept = true;"
                        "        }"
                        "        : image_button {"
                        "          key          = \"im17\";"
                        "          aspect_ratio = 1.42;"
                        "          height       = 7.5;"
                        "          color        = -2;"
                        "          allow_accept = true;"
                        "        }"
                        "        : image_button {"
                        "          key          = \"im18\";"
                        "          aspect_ratio = 1.42;"
                        "          height       = 7.5;"
                        "          color        = -2;"
                        "          allow_accept = true;"
                        "        }"
                        "        : image_button {"
                        "          key          = \"im19\";"
                        "          aspect_ratio = 1.42;"
                        "          height       = 7.5;"
                        "          color        = -2;"
                        "          allow_accept = true;"
                        "        }"
                        "        : image_button {"
                        "          key          = \"im20\";"
                        "          aspect_ratio = 1.42;"
                        "          height       = 7.5;"
                        "          color        = -2;"
                        "          allow_accept = true;"
                        "        }"
                        "      }"
                        "      : row {"
                        "        : image_button {"
                        "          key          = \"im21\";"
                        "          aspect_ratio = 1.42;"
                        "          height       = 7.5;"
                        "          color        = -2;"
                        "          allow_accept = true;"
                        "        }"
                        "        : image_button {"
                        "          key          = \"im22\";"
                        "          aspect_ratio = 1.42;"
                        "          height       = 7.5;"
                        "          color        = -2;"
                        "          allow_accept = true;"
                        "        }"
                        "        : image_button {"
                        "          key          = \"im23\";"
                        "          aspect_ratio = 1.42;"
                        "          height       = 7.5;"
                        "          color        = -2;"
                        "          allow_accept = true;"
                        "        }"
                        "        : image_button {"
                        "          key          = \"im24\";"
                        "          aspect_ratio = 1.42;"
                        "          height       = 7.5;"
                        "          color        = -2;"
                        "          allow_accept = true;"
                        "        }"
                        "        : image_button {"
                        "          key          = \"im25\";"
                        "          aspect_ratio = 1.42;"
                        "          height       = 7.5;"
                        "          color        = -2;"
                        "          allow_accept = true;"
                        "        }"
                        "      }"
                        "      : row {"
                        "        : column {"
                        "          : button {label= \"²Ä¤@­¶\"; key= \"a-beg\"; height= 2;}"
                        "          : button {label= \"³Ì¥½­¶\"; key= \"a-end\"; height= 2;}"
                        "        }"
                        "        : column {"
                        "          : button {label= \"¤W¤@­¶ &U\"; key= \"a-pre\"; height= 2;}"
                        "          : button {label= \"¤U¤@­¶ &D\"; key= \"a-net\"; height= 2;}"
                        "        }"
                        "        spacer_1;"
                        "        : column   {"
                        "          : button {label= \"§ó·s¤Û¿O¤ù\"; key= \"r_sld\"; height= 2;}"
                        "          : row {"
                        "            : toggle {label= \"¦h­«½Æ»s\"; key= \"xcop\";}"
                        "            : toggle {label= \"¤À¸Ñ\";     key= \"xblk\";}"
                        "          }"
                        "        }"
                        "        spacer_1;"
                        "        : column {"
                        "          : row  {"
                        "            : text       {label= \"¹Ï¼h:\"; key= \"tlay\";}"
                        "            : image      {key= \"layer_image\";  width= 4;}"
                        "            : popup_list {key= \"p_lay\";  edit_width= 15;}"
                        "          }"
                        "          : row  {"
                        "            : text       {label= \"¤ñ¨Ò:\"; key= \"tsca\";}"
                        "            : popup_list {key= \"p_sca\";  edit_width= 22;}"
                        "          }"
                        "        }"
                        "        spacer_1;"
                        "        : button {label= \"´¡¤J\"; key= \"inst\";   height= 4; fixed_width= true;}"
                        "        : button {label= \"¨ú®ø\"; key= \"cancel\"; height= 4; fixed_width= true; is_cancel= true;}"
                        "      }"
                        "    }"
                        "  }"
                        "}"

                        "////////////////////////////////////////////////////////////"
                        "//  ¤j¹Ï¹wÄý  //"

                        "Y340A : dialog {"
                        "  label = \"  ¨Ï¥ÎªÌBLOCK¹Ï®wºÞ²z_¹wÄýBLOCK\";"
                        "  spacer_1;"
                        "  : row    {"
                        "    : text {width = 40; key= \"bpath2\";}"
                        "    : text {width = 20; key= \"bfile\";}"
                        "  }"
                        "  spacer_1;"
                        "  : image {"
                        "    key     = \"s_image\";"
                        "    aspect_ratio = 1.42;"
                        "    height  = 40;"
                        "    color   = -2;"
                        "  }"
                        "  : row {"
                        "    : column {"
                        "      : text {label= \"\";}"
                        "      : row  {"
                        "        : button {label= \"²Ä¤@±i\"; key= \"s-beg\";}"
                        "        : button {label= \"³Ì¥½±i\"; key= \"s-end\";}"
                        "        spacer_1;"
                        "        : button {label= \"¤W¤@±i  &U\"; key= \"s-pre\";}"
                        "        : button {label= \"¤U¤@±i  &D\"; key= \"s-net\";}"
                        "        spacer_1;"
                        "        : button {"
                        "          label     = \"¦^«e­¶  &P\";"
                        "          key       = \"back\";"
                        "          is_cancel = true;"
                        "        }"
                        "      }"
                        "    }"
                        "    : button {"
                        "      label       = \"´¡¤J\";"
                        "      key         = \"sinst\";"
                        "      height      = 3;"
                        "      fixed_width = true;"
                        "    }"
                        "  }"
                        "}"

                        "////////////////////////////////////////////////////////////"
                        "//  ·s¼WÀɮצWºÙ  //"

                        "Y340G : dialog {"
                        "  label = \"  ·s¼WÀÉ®×\";"
                        "  spacer_1;"
                        "  spacer_1;"
                        "  : column {"
                        "    : edit_box {"
                        "      label = \"·s¼WÀɦW¡G\";"
                        "      key   = \"a-file\";"
                        "      width = 45;"
                        "    }"
                        "    : text {label = \"(¤£¥Î¥[µù°ÆÀɦW)\"; alignment = right;}"
                        "    spacer_1;"
                        "    : row {"
                        "      spacer_1;"
                        "      : column {"
                        "        : toggle {label= \"¦Û°Ê°õ¦æ\"; key= \"auto\";}"
                        "        : boxed_column {"
                        "          label       = \"  ­Ó§O°õ¦æ\";"
                        "          fixed_width = true;"
                        "          : toggle {label= \"BLOCK\";  key= \"mb\";}"
                        "          : toggle {label= \"¤Û¿O¤ù\"; key= \"ms\";}"
                        "        }"
                        "      }"
                        "      : column {"
                        "        : toggle {label= \"§ó´«¦Ü²Ä0¼h\"; key= \"blay\";}"
                        "        : text   {label = \"\";}"
                        "        : row {"
                        "          spacer_1;"
                        "          : button {"
                        "            label       = \"½T©w\";"
                        "            key         = \"ok\";"
                        "            height      = 4;"
                        "            fixed_width = true;"
                        "            is_default  = true;"
                        "          }"
                        "          : button {"
                        "            label       = \"¨ú®ø\";"
                        "            key         = \"cancel\";"
                        "            height      = 4;"
                        "            fixed_width = true;"
                        "            is_default  = false;"
                        "            is_cancel   = true;"
                        "          }"
                        "        }"
                        "      }"
                        "    }"
                        "  }"
                        "}"

                        "////////////////////////////////////////////////////////////"
                        "//  §R°£ÀÉ®×  //"

                        "Y340B : dialog {"
                        "  label = \"  §R°£ÀÉ®×\";"
                        "  spacer_1;"
                        "  : column {"
                        "    : text {label = \"½T©w§R°£¸ÓÀÉ®×¶Ü?\"; alignment = centered;}"
                        "    : text {key   = \"txt-31\";            alignment = centered;}"
                        "    spacer_1;"
                        "    : text {label = \"ª`·N :§R°£«á±N¥Ã»·µLªk¦^´_\"; alignment = centered;}"
                        "  }"
                        "  spacer_1;"
                        "  spacer_1;"
                        "  spacer_1;"
                        "  : row {"
                        "    : button {label= \"½T ©w\"; key= \"ok\";     is_default= true;}"
                        "    : button {label= \"¨ú ®ø\"; key= \"cancel\"; is_default= false; is_cancel= true;}"
                        "  }"
                        "}"

                        "////////////////////////////////////////////////////////////"
                        "//  §ó§ïÀɮצWºÙ  //"

                        "Y340C : dialog {"
                        "  label = \"  §ó§ïÀɮצWºÙ\";"
                        "  spacer_1;"
                        "  : column {"
                        "    : row  {"
                        "      : text {label = \"­ì¦³¦WºÙ¡G\";}"
                        "      : text {key   = \"txt-32\"; width = 30;}"
                        "    }"
                        "    spacer_1;"
                        "    : edit_box {"
                        "      label = \"§ó§ï¦WºÙ¡G\";"
                        "      key   = \"r-file\";"
                        "      width = 45;"
                        "    }"
                        "    : text {label = \"(¤£¥Î¥[µù°ÆÀɦW)\"; alignment = right;}"
                        "  }"
                        "  spacer_1;"
                        "  spacer_1;"
                        "  spacer_1;"
                        "  : row {"
                        "    : button {label= \"½T ©w\"; key= \"ok\";     is_default= true;}"
                        "    : button {label= \"¨ú ®ø\"; key= \"cancel\"; is_default= false; is_cancel= true;}"
                        "  }"
                        "}"

                        "////////////////////////////////////////////////////////////"
                        "//  §ó§ï¥Ø¿ý¦WºÙ  //"

                        "Y340D : dialog {"
                        "  label = \"  §ó§ï¥Ø¿ý¦WºÙ\";"
                        "  spacer_1;"
                        "  spacer_1;"
                        "  : edit_box {"
                        "    label = \"§ó§ï¥Ø¿ý¦WºÙ¡G\";"
                        "    key   = \"r-dir\";"
                        "    width = 45;"
                        "  }"
                        "  spacer_1;"
                        "  spacer_1;"
                        "  spacer_1;"
                        "  : row {"
                        "    : button {label= \"½T ©w\"; key= \"ok\";     is_default= true;}"
                        "    : button {label= \"¨ú ®ø\"; key= \"cancel\"; is_default= false; is_cancel= true;}"
                        "  }"
                        "}"

                        "////////////////////////////////////////////////////////////"
                        "//  ·s¼W¥Ø¿ý  //"

                        "Y340E : dialog {"
                        "  label = \"  ·s¼W¥Ø¿ý\";"
                        "  spacer_1;"
                        "  spacer_1;"
                        "  : edit_box {"
                        "    label = \"·s¼W¥Ø¿ý¦WºÙ¡G\";"
                        "    key   = \"a-dir\";"
                        "    width = 45;"
                        "  }"
                        "  spacer_1;"
                        "  spacer_1;"
                        "  spacer_1;"
                        "  : row {"
                        "    : button {label= \"½T ©w\"; key= \"ok\";     is_default= true;}"
                        "    : button {label= \"¨ú ®ø\"; key= \"cancel\"; is_default= false; is_cancel= true;}"
                        "  }"
                        "}"

                        "////////////////////////////////////////////////////////////"
                        "//  §R°£¥Ø¿ý  //"

                        "Y340F : dialog {"
                        "  label = \"  §R°£¥Ø¿ý\";"
                        "  spacer_1;"
                        "  : column {"
                        "    : text {label = \"½T©w§R°£¸Ó¥Ø¿ý¶Ü?\"; alignment = centered;}"
                        "    : text {key   = \"d-dir\";             alignment = centered;}"
                        "    spacer_1;"
                        "    : text {label = \"ª`·N :§R°£«á±N¥Ã»·µLªk¦^´_\"; alignment = centered;}"
                        "  }"
                        "  spacer_1;"
                        "  spacer_1;"
                        "  spacer_1;"
                        "  : row {"
                        "    : button {label= \"½T ©w\"; key= \"ok\";     is_default= true;}"
                        "    : button {label= \"¨ú ®ø\"; key= \"cancel\"; is_default= false; is_cancel= true;}"
                        "  }"
                        "}"
                       ) (write-line x dcl_file) )
                  (setq dcl_file (close dcl_file))
                  (< 0 (setq dcl_id (load_dialog tmp)))
              ) (if (not (new_dialog "Y340" dcl_id)) (exit)) ;; ª`·N ¦WºÙ¤j¼g
)   )    )


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;  ³]©w¥Ø¿ý¦WºÙ¦Cªí  >>>>>>

(defun :Y340-1: (/ d_list-1 d_list-2 dcl_id ybma xblk xcop num1 dirpath allnames listlength
                   listnames tempnames tempname n_page2 namestrip lg1 d_list-2 auto blay
                   ms_s ms_b fname lay y340_ui infile scl-x scl-y int-r name dfile obj bpath
                   sca_list lay_list lay str81 colorstr dd1 dd2 ch2 ch3 ch6 ch7 ch8 spath
                   Dos_dir Dos_subdir page_sld :Y340-9: :Y340-1A: :Y340-4: :Y340-25A: dcl_id
                   y340f_dwg y340f_sld txt-n dd31 dd32 dd33 dd34 dd35 a-file lst1_z lst2_z)

    (:load_dcl_Y340:) ;; ¸ü¤J¹ï¸Ü®Ø

    (defun Dos_dir (PathFile / strFileDir strFileBase StrFileExt)
        (setq strFileDir  (vl-filename-directory PathFile))
        (setq strFileBase (vl-filename-Base PathFile))
        (setq strFileExt  (vl-filename-extension PathFile))
        (vl-directory-files strFileDir (strcat strFileBase StrFileExt) 1) )

    (defun Dos_subdir (strPath)
        (vl-remove "." (vl-remove ".." (vl-directory-files strpath "*" -1))) )

    (setq d_list-1 (Dos_subdir :Y340_DWG:))

    (mode_tile "go_y340" 1) ;; ²H¤Æ"¦^¹Ï®w"
    (set_tile "tlay" "¹Ï¼h:")
    (set_tile "tsca" "¤ñ¨Ò:")

    (if (null xblk) (setq xblk 0)) ;; ¹w³]¤£¤À¸ÑBLOCK
    (if (= xblk 1)
        (set_tile "xblk" "1")   ;;   ¤À¸ÑBLOCK
        (set_tile "xblk" "0") ) ;; ¤£¤À¸ÑBLOCK

    (if (null xcop) (setq xcop 0)) ;; ¹w³]¤£¦h­«½Æ»s
    (if (= xcop 1)
        (set_tile "xcop" "1")   ;;   ¦h­«½Æ»s
        (set_tile "xcop" "0") ) ;; ¤£¦h­«½Æ»s

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;  Åã¥Ü¥Ø¿ý¦WºÙ¦Cªí  >>>>>>

    (defun :Y340-9: ()
        (start_list "list-1")
        (mapcar 'add_list d_list-1)
        (end_list) )  (:Y340-9:)
    (setq lst1_z (- (length d_list-1) 1)) ;; ¥Ø¿ý¤U¹ÏÀɼƶq

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    (if (null y340) (setq y340 "0")) (setq num1 y340) ;; °õ¦æ«e¤@¦¸Åã¥Ü­¶­±
    ;;(if (= num1 nil) (setq num1 "0") )             ;; ¨C¦¸°õ¦æ§¡Åã¥Ü²Ä1­¶
    (setq y340_fname1 (nth (atoi num1) d_list-1)) ;; y340_fname1 §Y¥Ø¿ý¦WºÙ
    (set_tile "list-1" num1)                      ;; °ª«G«×Åã¥Ü¥Ø¿ý¦Cªí¿ï¶µ
    ;;(if (= num2 nil) (setq num2 "0") )     ;; ¨C¦¸°õ¦æ§¡Åã¥Ü²Ä1­ÓÀɮצWºÙ

    (setq dirpath    (strcat :Y340_DWG: y340_fname1))        ;; BLOCK ¥Ø¿ý¸ô®|
    (setq allnames   (Dos_dir (strcat dirpath "/" "*.dwg"))) ;; ¥Ø¿ý¤U©Ò¦³¹ÏÀÉ
    (setq listlength (length allnames))

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;  §PÂ_¥Ø¿ý¤¤ÀÉ®×  >>>>>>

    (defun :Y340-1A: (/ i i2)
        (cond ((= listlength 0) ;; ¥Ø¿ý¤¤¨S¦³BLOCK(.dwg)¹ÏÀÉ®É
               (alert "¥Ø¿ý¤¤¦Ü¤Ö­n¦³ 1­Ó BLOCK(.dwg)¹ÏÀÉ¡A
                     \n«ØÄ³§A >>>     ¾ã²z¥Ø¿ý©Î§R°£¥Ø¿ý
                     \n         ******  µ{¦¡§Y±NÃö³¬  ******")
               (setq y340 "0") (done_dialog 0) (exit) )
              ((and (> listlength 0) (< listlength 26)) ;; ¥Ø¿ý¤¤¤£¶W¹L25­ÓBLOCK(.dwg)¹ÏÀÉ®É
               (setq lst2_z (- listlength 1)) ;; lst2_z -> BLOCK¹ÏÀɦCªí¤¤³Ì«á¤@­ÓÀÉ®×
               (setq i  0  listnames nil)
               (setq i2 0  tempnames nil)
               (repeat listlength
                   (setq tempname  (nth i allnames))
                   (setq listnames (append listnames (list tempname)))
                   (setq i (1+ i)) )
               (setq n_page2 (length listnames))
               (repeat n_page2
                   (setq namestrip (nth i2 listnames))
                   (setq lg1 (- (strlen namestrip) 4))
                   (setq namestrip (substr namestrip 1 lg1))
                   (setq tempnames (append tempnames (list namestrip)))
                   (setq i2 (1+ i2)) )
               (setq d_data-2 tempnames)
               (:Y340-2:) )
              ((> listlength 25) ;; ¥Ø¿ý¤¤¶W¹L25­ÓBLOCK(.dwg)¹ÏÀÉ®É
               (alert "¥Ø¿ý¤¤¤w¦s¦³ 25­Ó BLOCK(.dwg)¹ÏÀÉ¡A
                     \n«ØÄ³§A >>>     ¾ã²z¥Ø¿ý©Î§R°£¦h¾l¹ÏÀÉ
                     \n         ******  µ{¦¡§Y±NÃö³¬  ******")
               (setq y340 "0") (done_dialog 0) (exit))) )   (:Y340-1A:)
)


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;  ³]©w¥æ½Í®Ø¤Û¿O¤ù  >>>>>>

(defun :Y340-2: (/ dd1)
    (if (null y340_lay)
        (setq y340_lay "0") ) ;; ¹w³]¹Ï¼h¿ï³æ¤¤²Ä1­Ó¹Ï¼h
    (set_tile "p_lay" y340_lay)

    (if (null y340_image)
        (setq y340_image "0") ) ;; ¹w³]¹Ï¼h¿ï³æ¤¤²Ä1­Ó¹Ï¼h
    (setq lay y340_image)    ;; °õ¦æ«e¤@¦¸¹Ï¼h¹Ï¥Ü«ü©w¹Ï¼h

    ;; ¹w³]°õ¦æ¤ñ¨Ò&±ÛÂਤ«×¿ï³æ¤¤²Ä1¶µ-»P­ì¹Ï¬Û¦P
    (if (null y340_sca)
        (setq y340_sca "0") )
    (:Y340-16: y340_sca)

    (:Y340-13:) ;; Åã¥ÜBLOCK¹ÏÀɦCªí
    (:Y340-3:)  ;; Åã¥Ü¤Û¿O¤ù³]©w,¤£­n¶Ã§ïÅܦì¸m
    (:Y340-81:) ;; ³]©w¹Ï¼h¿ï³æ
    (:Y340-83:) ;; ³]©w¹Ï¼h¹Ï¥Ü
    (:Y340-15:) ;; ³]©w¤ñ¨Ò&±ÛÂਤ«×¿ï³æ

    (action_tile "go_y340" "(:Y340-14:)") ;; ¦^¹Ï®w
    (action_tile "browse1" "(:Y340-12:)") ;; ÂsÄý
    (action_tile "brow"    "(:Y340-41:)") ;; ¤j¹Ï¹wÄý
    (action_tile "list-1"  "(:Y340-22: $value d_list-1)") ;; BLOCK¥Ø¿ý¦Cªí
    (action_tile "list-2"  "(:Y340-24: $value d_list-2)") ;; BLOCK¦WºÙ¦Cªí

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;  ÂI¿ï¤Û¿O¤ù³]©w  >>>>>>

    (defun page_sld ()
        (action_tile "im1"  "(:Y340-7:  1)")
        (action_tile "im2"  "(:Y340-7:  2)")
        (action_tile "im3"  "(:Y340-7:  3)")
        (action_tile "im4"  "(:Y340-7:  4)")
        (action_tile "im5"  "(:Y340-7:  5)")
        (action_tile "im6"  "(:Y340-7:  6)")
        (action_tile "im7"  "(:Y340-7:  7)")
        (action_tile "im8"  "(:Y340-7:  8)")
        (action_tile "im9"  "(:Y340-7:  9)")
        (action_tile "im10" "(:Y340-7: 10)")
        (action_tile "im11" "(:Y340-7: 11)")
        (action_tile "im12" "(:Y340-7: 12)")
        (action_tile "im13" "(:Y340-7: 13)")
        (action_tile "im14" "(:Y340-7: 14)")
        (action_tile "im15" "(:Y340-7: 15)")
        (action_tile "im16" "(:Y340-7: 16)")
        (action_tile "im17" "(:Y340-7: 17)")
        (action_tile "im18" "(:Y340-7: 18)")
        (action_tile "im19" "(:Y340-7: 19)")
        (action_tile "im20" "(:Y340-7: 20)")
        (action_tile "im21" "(:Y340-7: 21)")
        (action_tile "im22" "(:Y340-7: 22)")
        (action_tile "im23" "(:Y340-7: 23)")
        (action_tile "im24" "(:Y340-7: 24)")
        (action_tile "im25" "(:Y340-7: 25)") )
    (page_sld)

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    (:Y340-26:) ;; ¿ï¨ú¤Û¿O¤ù®É¡ABLOCK¦WºÙ¦Cªí¦P¨B§ó·s

    (action_tile "a_dir"  "(:Y340-34:)")   ;; ·s¼W¥Ø¿ý
    (action_tile "d_dir"  "(:Y340-35:)")   ;; §R°£¥Ø¿ý
    (action_tile "r_dir"  "(:Y340-33:)")   ;; §ó§ï¥Ø¿ý
    (action_tile "a_file" "(:Y340-37:)")   ;; ·s¼WÀÉ®×
    (action_tile "d_file" "(:Y340-31:)")   ;; §R°£ÀÉ®×
    (action_tile "r_file" "(:Y340-32:)")   ;; §ó§ïÀɦW

    (action_tile "a-beg"  "(:Y340-29: 1)") ;; ²Ä¤@­¶
    (action_tile "a-end"  "(:Y340-29: 2)") ;; ³Ì¥½­¶
    (action_tile "a-pre"  "(:Y340-30: 1)") ;; ¤W¤@­¶
    (action_tile "a-net"  "(:Y340-30: 2)") ;; ¤U¤@­¶
    (:Y340-28:)          ;; ²H¤ÆÅã¥Ü"¤W¤@­¶"&"¤U¤@­¶"

    (action_tile "r_sld"  "(done_dialog 8)")    ;; §ó·s¤Û¿O¤ù
    (action_tile "p_lay"  "(:Y340-82: $value)") ;; ³]©w¹Ï¼h
    (action_tile "p_sca"  "(:Y340-16: $value)") ;; ³]©w¤ñ¨Ò&±ÛÂਤ«×
    (action_tile "xcop"   "(setq xcop (atoi $value)) (:Y340-6: 6)") ;; ¬O§_¦h­«½Æ»s
    (action_tile "xblk"   "(setq xblk (atoi $value)) (:Y340-6: 4)") ;; ¬O§_¤À¸ÑBLOCK
    (action_tile "inst"   "(setq fname (atof (get_tile \"list-2\"))) (done_dialog 5)") ;; BLOCK´¡¤J
    (action_tile "cancel" "(done_dialog 0)") ;; ¨ú®ø

    (setq dd1 (start_dialog))
    (cond ((= dd1 0) (princ "\n  *** ¨ú®ø ***"))
          ((= dd1 5) (:Y340-5:))    ;; °õ¦æBLOCK´¡¤J
          ((= dd1 7) (:Y340-8:))    ;; °õ¦æ·s¼WBLOCK & ¤Û¿O¤ùÀÉ®×
          ((= dd1 8) (:Y340-10:)) ) ;; °õ¦æ§ó·s¤Û¿O¤ù
    (unload_dialog dcl_id) )


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;  Åã¥Ü25±i¤Û¿O¤ù³]©w  >>>>>>

(defun :Y340-3: (/ i3 i4 key-list sld-list)
    (if (= y340_stch nil) (setq y340_stch 1)) ;; °ª«G«×Åã¥Ü²Ä1±i¤Û¿O¤ù
    (setq i3 1  key-list '())
    (setq i4 0  sld-list '())
    (repeat 25
        (setq key-list (append key-list (list (strcat "im" (itoa i3))) ))
        (if (< i4 n_page2)
            (progn
                (setq y340_ui  (nth i4 d_data-2))
                (setq sld-list (append sld-list (list (strcat dirpath "/" y340_ui ".sld"))))
            ) (setq sld-list (append sld-list (list (strcat dirpath "/" "xxx.sld"))) )
        ) (setq i3 (1+ i3)   i4 (1+ i4)) )
    (mapcar ':show-sld: key-list sld-list)

    (if dirdwg
        (setq bpath (strcat "Àɮץؿý : " spath "/"))
        (setq bpath (strcat "Àɮץؿý : " :Y340_DWG: y340_fname1 "/")) )
    (while (vl-string-search "/" bpath)
        (setq bpath (vl-string-subst "\\" "/" bpath)) )
    (set_tile "bpath1" bpath) ;; Åã¥ÜBLOCK¥Ø¿ý¸ô®|

    (setq fname (- y340_stch 1))
    (setq y340_ui (nth (fix fname) d_data-2))
    (set_tile "bfile" (strcat "<< " y340_ui ".dwg >>")) ;; §ó´«Åã¥ÜBLOCKÀɦW
    (mode_tile (strcat "im" (itoa y340_stch)) 4) )   ;; °ª«G«×Åã¥Ü¿ï¨ú¤Û¿O¤ù


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;  BLOCK´¡¤J  >>>>>>

(defun :Y340-5: (/ obj :Y340-4: v-infile ip5)
    (if lay
        (setvar "clayer" lay) ;; ³]©w¹Ï¼h ¸Ô (:Y340-82:)
        (setq lay (getvar "clayer")) )

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;  Ū¨úÀɮצWºÙ  >>>>>>

    (defun :Y340-4: ()
        (setq fname (- y340_stch 1))
        (setq y340_ui (nth (fix fname) d_data-2))
        (if y340_ui
            (setq infile (strcat dirpath "/" y340_ui)) ;; §¹¾ãÀɮ׸ô®|,¤£§t°ÆÀɦW
            (progn (alert "¡» ¿ù»~!!  ¨S¦³BLOCKÀÉ®×  µ{¦¡µ²§ô ¡»")
                   (setq y340_ui nil)
                   (setq y340_stch nil)
                   (setq allnames nil)
                   (exit) )
    )   )   (:Y340-4:)

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    (setq v-infile infile)
    (while (vl-string-search "/" v-infile)
        (setq v-infile (vl-string-subst "\\" "/" v-infile)) )
    (prompt (strcat "\n[" v-infile ".dwg] «ü©w´¡¤JÂI... "))

    (if (= xblk 1) ;; ¤À¸ÑBLOCK
        (progn
            (if (= ch8 4)
                (:Y340-17:) ;; BLOCK´¡¤J®É,¦Û­q¤ñ¨Ò
                (command "-INSERT" infile pause scl-x scl-y int-r) )
            (setq obj (ssget "L" (list (cons 0 "INSERT")))) ;; ¿ï¨ú´¡¤JªºBLOCK
            (command "._EXPLODE" obj) ) ;; ¤À¸Ñ´¡¤JªºBLOCK
        (progn
            (if (= ch8 4)
                (:Y340-17:) ;; BLOCK´¡¤J®É,¦Û­q¤ñ¨Ò
                (command "-INSERT" infile pause scl-x scl-y int-r) )
            (setq ip5 (getvar "lastpoint"))
            (if (= xcop 1) ;; ¦h­«½Æ»s¥\¯à
                (progn
                    (command "._COPY" "L" "" "_M" ip5)
                    (while (> (getvar "cmdactive") 0) (command pause))
                    ;; CMDACTIVE «ü¥Ü¤@¯ë«ü¥O¡B³z³q«ü¥O¡B¸}¥»©Î¹ï¸Ü¤è¶ô¬O§_³B©ó§@¥Î¤¤ª¬ºA
    )   )   )   )   (command "._REDRAW")   (setvar "clayer" slay) )


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;  Åã¥Ü/²H¤Æ °õ¦æ¶µ¥Ø  >>>>>>

(defun :Y340-6: (ch2)
    (cond
        ((= ch2 1) ;; ¿ï¾Ü­n°õ¦æ¶µ¥Ø
            (if (= ybma 0)
                (progn
                    (mode_tile "blay"   1)  ;; ²H¤Æ"§ó´«¦Ü²Ä0¼h"
                    (set_tile  "blay"  "0")
                    (mode_tile "auto"   1)  ;; ²H¤Æ"¦Û°Ê°õ¦æ"
                    (set_tile  "auto"  "0") (setq auto nil)
                    (mode_tile "ms"     1)  ;; ²H¤Æ"·s¼W¤Û¿O¤ù"
                    (set_tile  "ms"    "0") (setq ms_s nil)
                    (mode_tile "mb"     1)  ;; ²H¤Æ"·s¼WBLOCK"
                    (set_tile  "mb"    "0") (setq ms_b nil) )
                (progn
                    (mode_tile "blay"   0)  ;; Åã¥Ü"§ó´«¦Ü²Ä0¼h"
                    (set_tile  "blay"  "0")
                    (mode_tile "auto"   0)  ;; Åã¥Ü"¦Û°Ê°õ¦æ"
                    (set_tile  "auto"  "1") (setq auto 1)
                    (mode_tile "ms"     1)  ;; ²H¤Æ"·s¼W¤Û¿O¤ù"
                    (set_tile  "ms"    "0") (setq ms_s nil)
                    (mode_tile "mb"     1)  ;; ²H¤Æ"·s¼WBLOCK"
                    (set_tile  "mb"    "0") (setq ms_b nil)
        )   )   )

        ((= ch2 5) ;; ¿ï¾Ü¦Û°Ê·s«ØBLOCK & ¤Û¿O¤ù
            (if (= auto 0)
                (progn (mode_tile "ms" 0) (set_tile "ms" "1") (setq ms_s 1)
                       (mode_tile "mb" 0) (set_tile "mb" "1") (setq ms_b 1)
                       (setq auto nil))
                (progn (mode_tile "ms" 1) (set_tile "ms" "0") (setq ms_s nil)
                       (mode_tile "mb" 1) (set_tile "mb" "0") (setq ms_b nil)
                       (setq auto 1))) )

        ((= ch2 2) ;; ¿ï¾Ü·s«Ø¤Û¿O¤ù
            (set_tile "auto" "0") (setq auto nil)
            (if ms_s
                (progn
                    (setq ms_s nil)
                    (if (null ms_b) (progn (set_tile "mb" "1") (setq ms_b 1)) )
                )   (setq ms_s 1)) )

        ((= ch2 3) ;; ¿ï¾Ü·s«ØBLOCK
            (set_tile "auto" "0") (setq auto nil)
            (if ms_b
                (progn
                    (setq ms_b nil)
                    (if (null ms_s) (progn (set_tile "ms" "1") (setq ms_s 1)) )
                )   (setq ms_b 1)) )

        ((= ch2 6) ;; ¿ï¾Ü¦h­«½Æ»s
            (if (= xcop 0)
                (progn
                    (set_tile  "xcop" "0") ;; ¤£¦h­«½Æ»s
                    (mode_tile "xblk"  0)) ;; Åã¥Ü"¤À¸Ñ"BLOCK
                (progn
                    (set_tile  "xcop" "1") ;; ¦h­«½Æ»s
                    (mode_tile "xblk"  1)  ;; ²H¤Æ"¤À¸Ñ"BLOCK
                    (set_tile  "xblk" "0") (setq xblk nil))))

        ((= ch2 4) ;; ¿ï¾Ü­n°õ¦æ¶µ¥Ø
            (if (= xblk 0)
                (progn
                    (set_tile  "xblk" "0") ;; ¤£¤À¸ÑBLOCK
                    (mode_tile "xcop"  0)  ;; Åã¥Ü"¦h­«½Æ»s"
                    (mode_tile "tlay"  0)  ;; Åã¥Ü"¹Ï¼h"¤å¦r
                    (mode_tile "p_lay" 0)) ;; Åã¥Ü¹Ï¼h¦Cªí
                (progn
                    (set_tile  "xblk" "1") ;; ¤À¸ÑBLOCK
                    (mode_tile "xcop"  1)  ;; ²H¤Æ"¦h­«½Æ»s"
                    (set_tile  "xcop" "0") (setq xcop nil)
                    (mode_tile "tlay"  1)  ;; ²H¤Æ"¹Ï¼h"¤å¦r
                    (mode_tile "p_lay" 1)  ;; ²H¤Æ¹Ï¼h¦Cªí
)   )   )   )   )


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;  °ª«G«×Åã¥Ü¿ï¨ú¤Û¿O¤ù  >>>>>>

(defun :Y340-7: (ch3)
    (setq ybma 0) (:Y340-6: 1) ;; Ãö³¬·s¼W¤Û¿O¤ù& BLOCK
    (mode_tile (strcat "im" (itoa y340_stch)) 4) ;; im ¥²¶·¤p¼g ¤£Åã¥Ü¿ï¨ú¤Û¿O¤ù
    (setq y340_stch ch3)
    (mode_tile (strcat "im" (itoa y340_stch)) 4) ;; im ¥²¶·¤p¼g   Åã¥Ü¿ï¨ú¤Û¿O¤ù
    (:Y340-26:) )                         ;; ¿ï¨ú¤Û¿O¤ù®É¡ABLOCK¦WºÙ¦Cªí¦P¨B§ó·s


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;  °õ¦æ·s¼WBLOCK & ¤Û¿O¤ùÀÉ®×  >>>>>>

(defun :Y340-8: (/ p1 p3 p4 obj dfile dwgfile sldfile vw ss sss cp)
    (setvar "filedia" 0) ;; ¤£Åã¥Ü¹ï¸Ü¤è¶ô(¥»¦C¤£±o§ó§ï©Î§R°£)
    (setvar "osmode"  0) ;; µL (NON)
    (if dirdwg
        (setq dfile (strcat spath "/" a-file))
        (setq dfile (strcat :Y340_DWG: y340_fname1 "/" a-file)) )
    (setq dwgfile   (strcat dfile ".dwg"))
    (setq sldfile   (strcat dfile ".sld"))

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;  ·s¼WBLOCK  >>>>>>

    (if ms_b
        (progn
            (initget 1) (setq p1 (getpoint (strcat "\n[ " dwgfile " ] «ü©wBLOCK´¡¤J°ò·ÇÂI: ")))
            (princ "\n¿ï¨ú«Ø¥ßBLOCKª«¥ó... ")
            (setq obj (ssget))
            (if (= blay 1) ;; §ó§ïª«¥ó¦Ü²Ä0¼h
                (progn
                    (command "._COPY" obj "" "0,0,0" "0,0,0")
                    (setq ss (ssget "_P"))
                    (command "._CHANGE" obj "" "_P" "_LA" "0" "_LT" "ByBlock" "_C" "ByBlock" "")) )
            (if (findfile dwgfile)
                (command ".-WBLOCK" dwgfile "_Y" "" p1 obj "" "._OOPS")
                (command ".-WBLOCK" dwgfile "" p1 obj "" "._OOPS")
    )   )   )

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;  ·s¼W¤Û¿O¤ù  >>>>>>

    (if ms_s
        (progn
            (initget "Y N")
            (setq vw (getkword "\n¬O§_§ïÅܤۿO¤ùµøµ¡? (y/N) <N>: "))
            (if (null vw) (setq vw "N"))
            (cond ((= vw "Y")
                   (initget 1) (setq p3 (getpoint "\n«ü©w¤Û¿O¤ù²Ä¤@¨¤ÂI: "))
                   (initget 1) (setq p4 (getcorner p3 "\n«ü©w¤Û¿O¤ù¹ï¨¤ÂI: "))
                   (if (= obj nil) (setq obj (ssget "C" p3 p4)) )
                   (command "._ZOOM" "_W" p3 p4)
                   (command "._UNDO" "_M")
                   (if (= blay 1) ;; §ó§ïª«¥ó¦Ü²Ä0¼h
                       (progn
                           (command "._COPY" obj "" "0,0,0" "0,0,0")
                           (setq ss (ssget "_P"))
                           (command "._CHANGE" obj "" "_P" "_LA" "0" "_LT" "ByBlock" "_C" "ByBlock" "")
                           (command "._COPY" obj "" "0,0,0" "0,0,0")
                           (setq sss (ssget "_P"))) )
                   (command "._MSLIDE" sldfile)
                   (if (= blay 1) (command "._ERASE" sss ""))
                   (command "._UNDO" "_E" "._UNDO" "_B")
                   (if (and (= blay 1) (= ms_b 1)) (command "._ERASE" obj ""))
                   (command "._ZOOM" "_P") )

                  ((= vw "N")
                   (command "._UNDO" "_M")
                   (if (= blay 1) ;; §ó§ïª«¥ó¦Ü²Ä0¼h
                       (progn
                           (if (= obj nil)
                               (progn
                                   (princ "\n   *** ¿ï¨ú§ó§ï¦Ü²Ä0¼hª«¥ó... ***")
                                   (setq obj (ssget))) )
                           (command "._COPY" obj "" "0,0,0" "0,0,0")
                           (setq ss (ssget "_P"))
                           (command "._CHANGE" obj "" "_P" "_LA" "0" "_LT" "ByBlock" "_C" "ByBlock" "")
                           (command "._COPY" obj "" "0,0,0" "0,0,0")
                           (setq sss (ssget "_P"))
                           (command "._ZOOM" "_O" obj "")
                           (command "._ZOOM" "_S" "0.9x")) )
                   (command "._MSLIDE" sldfile)
                   (if (= blay 1) (command "._ERASE" sss ""))
                   (command "._UNDO" "_E" "._UNDO" "_B")
                   (if (and (= blay 1) (= ms_b 1)) (command "._ERASE" obj ""))
    )   )   )     )

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;  ·s¼W¦Û°Ê«Ø¥ßBLOCK & ¤Û¿O¤ù  >>>>>>

    (if auto
        (progn
            ;; ¦Û°Ê«Ø¥ßBLOCK
            (princ "¿ï¨ú«Ø¥ßBLOCK & ¤Û¿O¤ùª«¥ó... ")
            (setq obj (ssget))
            (initget 1) (setq p1 (getpoint "\n«ü©wBLOCK´¡¤J°ò·ÇÂI: "))
            ;; (:Y340-75: obj) (setq p1 cp) ;; ¦Û°Ê¥H¿ï¨úª«¥ó¤¤¤ßÂI¬°´¡¤J°ò·ÇÂI
            (if (= blay 1) ;; §ó§ïª«¥ó¦Ü²Ä0¼h
                (progn
                    (command "._COPY" obj "" "0,0,0" "0,0,0")
                    (setq ss (ssget "_P"))
                    (command "._CHANGE" obj "" "_P" "_LA" "0" "_LT" "ByBlock" "_C" "ByBlock" "")) )
            (if (findfile dwgfile)
                (command ".-WBLOCK" dwgfile "_Y" "" p1 obj "" "._OOPS")
                (command ".-WBLOCK" dwgfile "" p1 obj "" "._OOPS") )

            ;; ¦Û°Ê«Ø¥ß¤Û¿O¤ù
            (command "._UNDO" "_M")
            (if (= blay 1) ;; §ó§ïª«¥ó¦Ü²Ä0¼h
                (progn
                    (command "._COPY" obj "" "0,0,0" "0,0,0")
                    (setq sss (ssget "_P"))) )
            (command "._ZOOM" "_O" obj "")
            (command "._ZOOM" "_S" "0.9x")
            (command "._MSLIDE" sldfile)
            (if (= blay 1) (command "._ERASE" sss ""))
            (command "._UNDO" "_E" "._UNDO" "_B")
            (if (= blay 1) (command "._ERASE" obj ""))
    )   )

    (if (and (= blay 1) (/= ms_s 1)) (command "._ERASE" obj ""))
    (setvar "filedia" 1) ;; Åã¥Ü¹ï¸Ü¤è¶ô(¥»¦C¤£±o§ó§ï©Î§R°£)
    (setq obj nil) )


(defun :Y340-75: (obj / i ent mn mx cpx cpy x1 y1 x3 y3 xmin xmax ymin ymax)
    (setq i 0)
    (repeat (sslength obj)
        (setq ent (ssname obj i))
        (ax:GetBoundingBox ent)
        (if (= i 0)
            (progn
                (setq xmax x3) (setq xmin x1)
                (setq ymax y3) (setq ymin y1) )
            (progn
                (setq x3 (max xmax x3))
                (setq x1 (min xmin x1))
                (setq y3 (max ymax y3))
                (setq y1 (min ymin y1))
        )   ) (setq i (1+ i))
    ) (:Y340-77:) ) ;; ¨D¿ï¨úª«¥ó¤¤¤ßÂI

(defun ax:GetBoundingBox (ent / minp maxp) ;; ­nÄÀ©ñ mn mx
    (vla-getboundingbox (vlax-ename->vla-object ent) 'minp 'maxp)
    (setq mn (vlax-safearray->list minp))  ;; ¥ª¤U¨¤ÂI
    (setq mx (vlax-safearray->list maxp))  ;; ¥k¤W¨¤ÂI
    (setq x1 (car mn)  y1 (cadr mn))   ;; ¥ª¤U¨¤ÂI®y¼Ð
    (setq x3 (car mx)  y3 (cadr mx)) ) ;; ¥k¤W¨¤ÂI®y¼Ð

(defun :Y340-77: ()
    ;; ¨Dª«¥ó¤¤¤ßÂI
    (setq cpx (+ (/ (- x3 x1) 2) x1))
    (setq cpy (+ (/ (- y3 y1) 2) y1))
    (setq cp  (list cpx cpy)) ) ;; ¹Ï§Î¤¤¤ßÂI


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;  °õ¦æ§ó·s¤Û¿O¤ù  >>>>>>

(defun :Y340-10: (/ dir_path scr:path file_list scr:file i)
    (alert (strcat "\n§ó·s¤Û¿O¤ù«e, ±N·|Ãö³¬°õ¦æµ{¦¡,
                    \n«Ý§ó·s§¹¦¨«á, ½Ð¦A¤@¦¸¶}±Òµ{¦¡,
                    \n** µu¼È¥ð®§, ¬O¬°¤F¬ü¦nªº¥¼¨Ó **"))
    (if (or (= (getvar "SDI") 0) (> (getvar "DBMOD") 0))
        (progn
            (setq dir_path (strcat dirpath "/")) ;; ¥Ø¿ý¸ô®|
            (while (vl-string-search "/" dir_path)
                (setq dir_path (vl-string-subst "\\" "/" dir_path)) )
            (setq scr:path  (strcat dir_path "Y340.scr")) ;; ¸}¥»¸ô®|
            (setq file_list (vl-directory-files dir_path "*.dwg" 1)) ;; ¥Ø¿ý¸ô®|¤U©Ò¦³(.dwg)¹ÏÀÉ
            (alert (strcat "¦@¿ï¨ú " (itoa (length file_list)) " ­Ó¹ÏÀÉ¡A½Ð«ö¡i½T©w¡jÄ~Äò°õ¦æ... "))
            (setq i 0)
            (repeat (length file_list)
                (setq scr:file (open scr:path "w"))
                (foreach dwg file_list
                    (write-line "._OPEN" scr:file)
                    (write-line (strcat "\"" dir_path dwg "\"") scr:file)
                    (write-line "(command \"._ZOOM\" \"_E\" \"._ZOOM\" \"_S\" \"0.95x\")" scr:file)
                    (write-line "(command \"._MSLIDE\" (strcat (getvar \"dwgprefix\")
                                 (vl-filename-base (getvar \"dwgname\")) \".sld\"))" scr:file)
                    (write-line "._CLOSE" scr:file)
                    (write-line "_Y" scr:file)
                    (setq i (1+ i)) )
                (close scr:file)
            )   (command "._SCRIPT" scr:path)
)   )   )


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;  §¹¾ãªº¸ê®Æ§¨¸ô®|  >>>>>>

(defun Wshell (msg / WinShell shFolder path catchit)
    (setq WinShell (vlax-create-object "Shell.Application"))
    ;;(vlax-dump-object WinShell T)
    (setq shFolder (vlax-invoke-method WinShell 'BrowseForFolder 0 msg 1))
    (setq catchit (vl-catch-all-apply '(lambda ()
                                   (setq shFolder (vlax-get-property shFolder 'self))
                                   (setq path (vlax-get-property shFolder 'path))
    ))) (if (vl-catch-all-error-p catchit) nil path) )


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;  «ü©w¨ä¥LBLOCK¹ÏÀÉ®É ªì©l­È³]©w  >>>>>>

(defun :Y340-11: ()
    (setq y340       "0")
    (setq num1       "0")
    (setq num2       "0")
    (setq y340_lay   "0")
    (setq y340_image "0")
    (setq y340_sca   "0")
    (setq ybma        0)
    (setq y340_stch   1) )


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;  ÂsÄý_¨ä¥LBLOCK¹ÏÀÉ¸ê®Æ  >>>>>>

(defun :Y340-12: ()
    (setq spath (Wshell "«ü©w¦s©ñBLOCK(.dwg)ÀÉ®×¸ê®Æ§¨
                       \n*** ¿ï¨ú¤è¦¡¦p :  D:\\«Ø¿v\\§O¹Ö\\¥­­±¹Ï.dwg    ¤£¯à«ü©w[«Ø¿v]¥Ø¿ý,½Ð«ü©w[§O¹Ö]¥Ø¿ý ***")) ;; spath §¹¾ãªº·s¸ê®Æ§¨¸ô®|
    (if spath
        (progn
            (:Y340-11:)
            (setq dirdwg t)
            (while (vl-string-search "\\" spath)
                (setq spath (vl-string-subst "/" "\\" spath)) )
            (:Y340-25:)         ;; ­«·s¿ï¨úBLOCK¥Ø¿ý¦Cªí³]©w
            (setq d_list-1 nil) (:Y340-9:) ;; ²M°£_­«¸m"¥Ø¿ý"
            (mode_tile "go_y340" 0) ;; Åã¥Ü"¦^¹Ï®w"
            (mode_tile "list-1"  1) ;; ²H¤ÆBLOCK¥Ø¿ý¦Cªí
            (mode_tile "a_dir"   1) ;; ²H¤Æ·s¼W¥Ø¿ý
            (mode_tile "d_dir"   1) ;; ²H¤Æ§R°£¥Ø¿ý
            (mode_tile "r_dir"   1) ;; ²H¤Æ§ó§ï¥Ø¿ý
            (mode_tile "a-beg"   1) ;; ²H¤Æ²Ä¤@­¶
            (mode_tile "a-end"   1) ;; ²H¤Æ³Ì¥½­¶
            (mode_tile "a-pre"   1) ;; ²H¤Æ¤W¤@­¶
            (mode_tile "a-net"   1) ;; ²H¤Æ¤U¤@­¶
            (:Y340-26:)    ;; ¿ï¨úBLOCK¥Ø¿ý¦Cªí®É¡ABLOCK¦WºÙ¦Cªí¦P¨B§ó·s
            (:Y340-3:))) ) ;; ­«¸m¤Û¿O¤ù


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;  Åã¥ÜBLOCK¹ÏÀɦCªí  >>>>>>

(defun :Y340-13: ()
    (start_list "list-2")
    (mapcar 'add_list d_data-2)
    (end_list) )


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;  ¦^¹Ï®w  >>>>>>

(defun :Y340-14: ()
    (setq spath nil) (setq dirdwg nil) (:Y340-11:) ;; ¦^Âkªì©l­È³]©w
    (setq d_list-1 (Dos_subdir :Y340_DWG:)) (:Y340-9:)  ;; ­«¸m"¥Ø¿ý"
    (setq lst1_z (- (length d_list-1) 1))          ;; ¥Ø¿ý¤¤¹ÏÀɼƶq
    (setq y340_fname1 (nth (atoi num1) d_list-1))  ;; y340_fname1 §Y¥Ø¿ý¦WºÙ
    (set_tile "list-1" num1)                       ;; °ª«G«×Åã¥Ü¥Ø¿ý¦Cªí¿ï¶µ
    (mode_tile "go_y340" 1) ;; ²H¤Æ"¦^¹Ï®w"
    (mode_tile "list-1"  0) ;; Åã¥ÜBLOCK¥Ø¿ý¦Cªí
    (mode_tile "a_dir"   0) ;; Åã¥Ü·s¼W¥Ø¿ý
    (mode_tile "d_dir"   0) ;; Åã¥Ü§R°£¥Ø¿ý
    (mode_tile "r_dir"   0) ;; Åã¥Ü§ó§ï¥Ø¿ý
    (mode_tile "a-beg"   0) ;; Åã¥Ü²Ä¤@­¶
    (mode_tile "a-end"   0) ;; Åã¥Ü³Ì¥½­¶
    (mode_tile "a-pre"   0) ;; Åã¥Ü¤W¤@­¶
    (mode_tile "a-net"   0) ;; Åã¥Ü¤U¤@­¶
    (:Y340-25:) ;; ­«·s¿ï¨úBLOCK¥Ø¿ý¦Cªí³]©w
    (:Y340-26:) ;; ¿ï¨úBLOCK¥Ø¿ý¦Cªí®É¡ABLOCK¦WºÙ¦Cªí¦P¨B§ó·s
    (:Y340-3:)) ;; ­«¸m¤Û¿O¤ù


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;  Åã¥Ü¤ñ¨Ò&±ÛÂਤ«×¿ï³æ  >>>>>>  ¨Ï¥ÎªÌ¥i¥[¤J¨ä¥L¿ï¶µ

(defun :Y340-15: ()
    (setq sca_list '(" X=1,  Y=1, R=0" ;; ¤ñ¨Ò&±ÛÂਤ«×»P­ì¹Ï¬Û¦P
                     "¤½ÍùÂऽ¤À, R=0" ;; ¤ñ¨Ò¥Ñ¤½ÍùÂऽ¤À,±ÛÂਤ«×»P­ì¹Ï¬Û¦P
                     "­^¦TÂऽ¤À, R=0" ;; ¤ñ¨Ò¥Ñ­^¦TÂऽ¤À,±ÛÂਤ«×»P­ì¹Ï¬Û¦P
                     "¦Û­q"         )) ;; ¦Û­q¤ñ¨Ò&±ÛÂਤ«×
    (start_list "p_sca")
    (mapcar 'add_list sca_list)
    (end_list) )


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;  ³]©wBLOCK´¡¤J®Éªº¤ñ¨Ò&±ÛÂਤ«×  >>>>>>  ¨Ï¥ÎªÌ¥i¥[¤J¨ä¥L¿ï¶µ

(defun :Y340-16: (n-sca)
    (set_tile "p_sca" n-sca)
    (setq y340_sca    n-sca)
    (setq ch8 (+ (atoi n-sca) 1))
    (cond ((= ch8 1) (setq scl-x "1"     scl-y "1"     int-r "0")) ;; ¤ñ¨Ò&±ÛÂਤ«×»P­ì¹Ï¬Û¦P
          ((= ch8 2) (setq scl-x "0.1"   scl-y "0.1"   int-r "0")) ;; ¤ñ¨Ò¥Ñ¤½ÍùÂऽ¤À,±ÛÂਤ«×»P­ì¹Ï¬Û¦P
          ((= ch8 3) (setq scl-x "2.54"  scl-y "2.54"  int-r "0")) ;; ¤ñ¨Ò¥Ñ­^¦TÂऽ¤À,±ÛÂਤ«×»P­ì¹Ï¬Û¦P
)   )


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;  ¦Û­q¤ñ¨Ò_BLOCK´¡¤J®É,INSERT «ü©w¤À¸Ñ»yªk  >>>>>>

(defun :Y340-17: (/ sx sy)
    (command "-INSERT" infile pause)
    (setq sx (getreal "\n¿é¤J X ¤ñ¨Ò«Y¼Æ <1>: "))
    (if (= sx nil) (setq sx 1)) (command sx)
    (setq sy (getreal "\n¿é¤J Y ¤ñ¨Ò«Y¼Æ <¨Ï¥Î X ¤ñ¨Ò«Y¼Æ>: "))
    (if (= sy nil) (setq sy sx)) (command sy)
    (prompt "«ü©w±ÛÂਤ«× <0>: ")
    (command pause) )


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;  ¥Ø¿ý¦WºÙ»PBLOCKÀɮצWºÙ¦Cªí  >>>>>>

(defun :Y340-22: (num1 d_list-1)
    (setq y340_fname1 (nth (atoi num1) d_list-1)) ;; y340_fname1 §Y¥Ø¿ý¦WºÙ
    (set_tile "list-1" num1)                      ;; °ª«G«×Åã¥Ü¥Ø¿ý¦Cªí¿ï¶µ
    (setq y340 num1)               ;; °t¦X(:Y340-1:)°õ¦æ«e¤@¦¸Åã¥Ü­¶­±(­«­n)
    (setq y340_stch 1)          ;; ³]©w§ó´«¥Ø¿ý¦WºÙ®É,Åã¥Ü²Ä1±i¤Û¿O¤ù¤ÎÀɦW

    (:Y340-25:) ;; ­«·s¿ï¨úBLOCK¥Ø¿ý¦Cªí³]©w
    (:Y340-26:) ;; ¿ï¨úBLOCK¥Ø¿ý¦Cªí®É¡ABLOCK¦WºÙ¦Cªí¦P¨B§ó·s
    (:Y340-3:)) ;; ­«¸m¤Û¿O¤ù


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;  BLOCK¦WºÙ¦Cªí  >>>>>>

(defun :Y340-24: (num2 d_list-2)
    (if dirdwg (mode_tile "list-1" 1)) ;; ²H¤ÆBLOCK¥Ø¿ý¦Cªí
    ;;(setq y340_fname2 (nth (atoi num2) d_list-2)) ;; y340_fname2 §YÀɮצWºÙ
    (setq ch2 (+ (atoi num2) 1))           ;; ¥Ñ¦Cªí¿ï¨ú ¦P®É§ó´«¤Û¿O¤ùÅã¥Ü
    (:Y340-7: ch2) )


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;  ­«·s¿ï¨úBLOCK¥Ø¿ý¦Cªí³]©w  >>>>>>

(defun :Y340-25: ()
    (if dirdwg
        (setq dirpath spath)
        (setq dirpath (strcat :Y340_DWG: y340_fname1)) )     ;; BLOCK ¥Ø¿ý¸ô®|
    (setq allnames   (Dos_dir (strcat dirpath "/" "*.dwg"))) ;; ¥Ø¿ý¤U©Ò¦³¹ÏÀÉ
    (setq listlength (length allnames))

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;  §PÂ_¥Ø¿ý¤¤ÀÉ®×  >>>>>>

    (defun :Y340-25A: (/ i i2)
        (cond ((= listlength 0) ;; ¥Ø¿ý¤¤¨S¦³BLOCK(.dwg)¹ÏÀÉ®É
               (alert "¥Ø¿ý¤¤¦Ü¤Ö­n¦³ 1­Ó BLOCK(.dwg)¹ÏÀÉ¡A
                     \n«ØÄ³§A >>>     ¾ã²z¥Ø¿ý©Î§R°£¥Ø¿ý
                     \n         ******  µ{¦¡§Y±NÃö³¬  ******")
               (setq y340 "0") (done_dialog 0) )
              ((and (> listlength 0) (< listlength 26)) ;; ¥Ø¿ý¤¤¤£¶W¹L25­ÓBLOCK(.dwg)¹ÏÀÉ®É
               (setq lst2_z (- listlength 1))       ;; lst2_z -> BLOCK¹ÏÀɦCªí¤¤³Ì«á¤@­ÓÀÉ®×
               (setq i  0  listnames nil)
               (setq i2 0  tempnames nil)
               (repeat listlength
                   (setq tempname  (nth i allnames))
                   (setq listnames (append listnames (list tempname)))
                   (setq i (1+ i)) )
               (setq n_page2 (length listnames))
               (repeat n_page2
                   (setq namestrip (nth i2 listnames))
                   (setq lg1 (- (strlen namestrip) 4))
                   (setq namestrip (substr namestrip 1 lg1))
                   (setq tempnames (append tempnames (list namestrip)))
                   (setq i2 (1+ i2)) )
               (setq d_data-2 tempnames) )
              ((> listlength 25) ;; ¥Ø¿ý¤¤¶W¹L25­ÓBLOCK(.dwg)¹ÏÀÉ®É
               (alert "¥Ø¿ý¤¤¶W¹L25­ÓBLOCK(.dwg)¹ÏÀÉ¡A
                     \n«ØÄ³§A >>>     ¾ã²z¥Ø¿ý©Î§R°£¦h¾l¹ÏÀÉ
                     \n         ******  µ{¦¡§Y±NÃö³¬  ******")
               (setq y340 "0") (done_dialog 0))) )   (:Y340-25A:)

        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
        ;;  ¿ï¨ú¥Ø¿ý¦Cªí®É¡ABLOCK¦WºÙ¦Cªí¦P¨B§ó·s  >>>>>>

        (:Y340-28:) ;; ²H¤Æ/Åã¥Ü"¤W¤@­¶"&"¤U¤@­¶"
        (setq d_list-2 (Dos_dir (strcat dirpath "/" "*.dwg")))
        (:Y340-13:) )


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;  ¿ï¨úBLOCK¥Ø¿ý¦Cªí®É¡A¤Û¿O¤ù¦P¨B§ó·s  >>>>>>

(defun :Y340-26: ()
    (if (> y340_stch n_page2) (:Y340-7: n_page2)) ;; ¨S¦³ÀÉ®× °ª«G«×Åã¥Ü¤Û¿O¤ù³Ì«á¶µ
    (setq fname (- y340_stch 1))
    (setq y340_ui (nth (fix fname) d_data-2))

    (setq y340f_dwg (strcat dirpath "/" y340_ui ".dwg"))
    (if (/= (findfile (setq y340f_sld (strcat dirpath "/" y340_ui ".sld"))) nil)
        (setq txt-n   (strcat y340_ui ".dwg & .sld   ¨â­ÓÀÉ®×"))
        (setq txt-n   (strcat y340_ui ".dwg   ¤@­ÓÀÉ®×")) )

    (if y340_ui
        (progn
            (set_tile "bfile"  (strcat "<< " y340_ui ".dwg >>")) ;; §ó´«Åã¥ÜBLOCKÀɦW
            (set_tile "list-2" (itoa fname)) )         ;; °ª«G«×Åã¥ÜBLOCK¦WºÙ¦Cªí¿ï¶µ
        (progn
            (set_tile "bfile" "¡»  ¿ù»~!!  ¨S¦³BLOCKÀÉ®×  ¡»")
            (set_tile "list-2" (itoa n_page2)) ;; ¨S¦³ÀÉ®× °ª«G«×Åã¥ÜBLOCK¦WºÙ¦Cªí³Ì«á¶µ
)   )   )


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;  ²H¤Æ/Åã¥Ü"¤W¤@­¶"&"¤U¤@­¶"  >>>>>>

(defun :Y340-28: ()
    (setq num1 y340)
    (cond ((= (atoi num1) 0)
           (mode_tile "a-beg" 1) (mode_tile "a-end" 0)
           (mode_tile "a-pre" 1) (mode_tile "a-net" 0) )
          ((= (atoi num1) lst1_z)
           (mode_tile "a-beg" 0) (mode_tile "a-end" 1)
           (mode_tile "a-pre" 0) (mode_tile "a-net" 1) )
          ((or (/= (atoi num1) 0) (/= (atoi num1) lst1_z))
           (mode_tile "a-beg" 0) (mode_tile "a-end" 0)
           (mode_tile "a-pre" 0) (mode_tile "a-net" 0)) )
    (if dirdwg
        (progn (mode_tile "a-end" 1) (mode_tile "a-net" 1))) )


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;  ¦^²Ä¤@­¶ & ¦Ü³Ì¥½­¶  >>>>>>

(defun :Y340-29: (ch29)
    (setq num1 y340)
    (cond ((= ch29 1)
           (mode_tile "a-beg" 1) (mode_tile "a-end" 0)
           (setq num1 "0"))             ;; ¦^²Ä¤@­¶¥Ø¿ý
          ((= ch29 2)
           (mode_tile "a-beg" 0) (mode_tile "a-end" 1)
           (setq num1 (itoa lst1_z))) ) ;; ¦Ü³Ì¥½­¶¥Ø¿ý

    (:Y340-22: num1 d_list-1) ) ;; ­«¸m¥Ø¿ý¦WºÙ»PBLOCKÀɮצWºÙ¦Cªí


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;  ¤W¤@­¶ & ¤U¤@­¶  >>>>>>

(defun :Y340-30: (ch30 / num1a)
    (setq num1 y340)
    (cond ((= ch30 1) (setq num1a (- (atoi num1) 1)))   ;; ¤W¤@­¶¥Ø¿ý
          ((= ch30 2) (setq num1a (+ (atoi num1) 1))) ) ;; ¤U¤@­¶¥Ø¿ý

    (setq num1 (itoa num1a))
    (:Y340-22: num1 d_list-1) ) ;; ­«¸m¥Ø¿ý¦WºÙ»PBLOCKÀɮצWºÙ¦Cªí


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;  §R°£ÀÉ®×  >>>>>>

(defun Dos_Delete (StrFile)  (vl-file-delete StrFile) )

(defun :Y340-31: (/ dd31)
    (if (= n_page2 1)
        (alert "¥Ø¿ý¤¤¦Ü¤Ö­n¦³ 1­Ó BLOCK(.dwg)¹ÏÀÉ¡A
              \n­Y¨S¦³¥ô¦ó¹ÏÀÉ¡A°õ¦æ¤£·í®Éµ{¦¡±N·|Ãö³¬¡A
              \n¦pªG§A¤@©w­n§R°£ÀɮסA    «ØÄ³§A >>>
              \n***  ½Ð°õ¦æ[§R°£¥Ø¿ý]¡A±N¥Ø¿ý»PÀɮפ@¨Ö§R°£  ***") )
    (if (not (new_dialog "Y340B" dcl_id)) (exit)) ;; Y340B ¥²¶·¤j¼g
    (set_tile "txt-31" txt-n)
    (action_tile "accept" "(done_dialog 1)")
    (action_tile "cancel" "(done_dialog 0)")
    (setq dd31 (start_dialog))
    (cond ((= dd31 1)
           (if (= y340f_sld nil) (Dos_Delete y340f_dwg)
               (progn (Dos_Delete y340f_dwg) (Dos_Delete y340f_sld)) )
           (:Y340-25:)    ;; ­«·s¿ï¨úBLOCK¥Ø¿ý¦Cªí³]©w
           (:Y340-26:)    ;; ¿ï¨úBLOCK¥Ø¿ý¦Cªí®É¡ABLOCK¦WºÙ¦Cªí¦P¨B§ó·s
           (:Y340-3:))) ) ;; ­«¸m¤Û¿O¤ù


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;  §ó§ïÀɦW  >>>>>>

(defun Dos_Rename (RenForm Rento)  (vl-file-rename RenForm RenTo) )

(defun :Y340-32: (/ ren-path r-file dd32)
    (if (not (new_dialog "Y340C" dcl_id)) (exit)) ;; Y340C ¥²¶·¤j¼g
    (setq ren-path (strcat dirpath "/"))
    (while (vl-string-search "/" ren-path)
        (setq ren-path (vl-string-subst "\\" "/" ren-path)) )
    (set_tile "txt-32" txt-n)
    (set_tile "r-file" y340_ui)
    (action_tile "r-file" "(setq r-file $value)")
    (action_tile "accept" "(done_dialog 1)")
    (action_tile "cancel" "(setq r-file nil) (done_dialog 0)")
    (setq r-file (get_tile "r-file"))
    (setq dd32 (start_dialog))
    (cond ((= dd32 1)
           (if (= r-file "")
               (progn (alert "*** ½Ð¿é¤J[§ó§ïÀɮצWºÙ] ***") (:Y340-32:) )
               (progn
                   (if (findfile (strcat ren-path r-file ".dwg"))
                       (progn
                           (alert (strcat "*** ÀÉ®× << " r-file ".dwg >> ¤w¦s¦b¡A½Ð­«·s©R¦W ***"))
                           (:Y340-32:) )
                       (progn
                           (if (= y340f_sld nil)
                               (Dos_Rename (strcat ren-path y340_ui ".dwg") (strcat ren-path r-file ".dwg"))
                               (progn
                                   (Dos_Rename (strcat ren-path y340_ui ".dwg") (strcat ren-path r-file ".dwg"))
                                   (Dos_Rename (strcat ren-path y340_ui ".sld") (strcat ren-path r-file ".sld"))
                           )   )
                           (:Y340-25:) ;; ­«·s¿ï¨úBLOCK¥Ø¿ý¦Cªí³]©w
                           (:Y340-26:) ;; ¿ï¨úBLOCK¥Ø¿ý¦Cªí®É¡ABLOCK¦WºÙ¦Cªí¦P¨B§ó·s
                           (:Y340-3:)  ;; ­«¸m¤Û¿O¤ù
)   )     ))   )   )   )


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;  ·s¼WÀÉ®×  >>>>>>

(defun :Y340-37: (/ add-path dd37)
    (if (= n_page2 25)
        (alert "¥Ø¿ý¤¤¤w¦s¦³ 25­Ó BLOCK(.dwg)¹ÏÀÉ¡A
              \n­Y¶W¹L25­Ó¹ÏÀÉ¡A°õ¦æ¤£·í®Éµ{¦¡±N·|Ãö³¬¡A
              \n¦pªG§A¤@©w­n·s¼WÀɮסA    «ØÄ³§A >>>
              \n***  ¥ý°õ¦æ[·s¼W¥Ø¿ý]¡A¦A·s¼WÀÉ®×  ***") )
    (if (not (new_dialog "Y340G" dcl_id)) (exit)) ;; Y340G ¥²¶·¤j¼g
    (setq add-path (strcat dirpath "/"))
    (while (vl-string-search "/" add-path)
        (setq add-path (vl-string-subst "\\" "/" add-path)) )
    (setq ybma 1) (:Y340-6: 1)
    (set_tile "a-file" y340_ui)
    (action_tile "a-file" "(setq a-file $value)")
    (action_tile "auto"   "(setq auto (atoi $value)) (:Y340-6: 5)") ;; ¬O§_¦Û°Ê«Ø¥ßBLOCK & ¤Û¿O¤ù
    (action_tile "mb"     "(setq ms_b (atoi $value)) (:Y340-6: 3)") ;; ¬O§_·s¼WBLOCK
    (action_tile "ms"     "(setq ms_s (atoi $value)) (:Y340-6: 2)") ;; ¬O§_·s¼W¤Û¿O¤ù
    (action_tile "blay"   "(setq blay (atoi $value))")              ;; ¬O§_§ó´«¦Ü²Ä0¼h
    (action_tile "accept" "(setq ybma 0) (done_dialog 1)")
    (action_tile "cancel" "(setq a-file nil) (done_dialog 0)")
    (setq a-file (get_tile "a-file"))
    (setq dd37 (start_dialog))
    (cond ((= dd37 1)
           (if (= a-file "")
               (progn (alert "*** ½Ð¿é¤J[·s¼WÀɮצWºÙ] ***") (:Y340-37:) )
               (progn
                   (cond
                       ((or (= auto 1) (= ms_b 1))
                        (if (findfile (strcat add-path a-file ".dwg"))
                            (progn
                                (alert (strcat "*** ÀÉ®× << " a-file ".dwg >> ¤w¦s¦b¡A½Ð­«·s©R¦W ***"))
                                (:Y340-37:) )
                            (progn (done_dialog 7))) )
                       ((= ms_s 1)
                        (if (findfile (strcat add-path a-file ".sld"))
                            (progn
                                (alert (strcat "*** ÀÉ®× << " a-file ".sld >> ¤w¦s¦b¡A½Ð­«·s©R¦W ***"))
                                (:Y340-37:) )
                            (progn (done_dialog 7)
)   )     ))   )   )   ))   )


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;  §ó§ï¥Ø¿ý  >>>>>>

(defun :Y340-33: (/ r-dir dd33)
    (if (not (new_dialog "Y340D" dcl_id)) (exit)) ;; Y340D ¥²¶·¤j¼g
    (set_tile "r-dir" y340_fname1)
    (action_tile "r-dir"  "(setq r-dir $value)")
    (action_tile "accept" "(done_dialog 1)")
    (action_tile "cancel" "(setq r-dir nil) (done_dialog 0)")
    (setq r-dir (get_tile "r-dir"))
    (setq dd33 (start_dialog))
    (cond ((= dd33 1)
           (if (= r-dir "")
               (progn (alert "*** ½Ð¿é¤J[§ó§ï¥Ø¿ý¦WºÙ] ***") (:Y340-33:) )
               (progn
                   (if (findfile (strcat :Y340_DWG: r-dir))
                       (progn
                           (alert (strcat "*** ¥Ø¿ý << " r-dir " >> ¤w¦s¦b¡A½Ð­«·s©R¦W ***"))
                           (:Y340-33:) )
                       (progn
                           (Dos_Rename (strcat :Y340_DWG: y340_fname1) (strcat :Y340_DWG: r-dir))
                           (:Y340-36:)
)   )     ))   )   )   )


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;  ·s¼W¥Ø¿ý  >>>>>>

(defun Dos_Mkdir (StrPath)  (vl-mkdir StrPath) )

(defun :Y340-34: (/ a-dir dd34 fn34)
    (if (not (new_dialog "Y340E" dcl_id)) (exit)) ;; Y340E ¥²¶·¤j¼g
    (set_tile "a-dir" y340_fname1)
    (action_tile "a-dir"  "(setq a-dir $value)")
    (action_tile "accept" "(done_dialog 1)")
    (action_tile "cancel" "(setq a-dir nil) (done_dialog 0)")
    (setq a-dir (get_tile "a-dir"))
    (setq dd34 (start_dialog))
    (cond ((= dd34 1)
           (if (= a-dir "")
               (progn (alert "*** ½Ð¿é¤J[·s¼W¥Ø¿ý¦WºÙ] ***") (:Y340-34:) )
               (progn
                   (if (findfile (strcat :Y340_DWG: a-dir))
                       (progn
                           (alert (strcat "*** ¥Ø¿ý << " a-dir " >> ¤w¦s¦b¡A½Ð­«·s©R¦W ***"))
                           (:Y340-34:) )
                       (progn
                           (Dos_Mkdir (strcat :Y340_DWG: a-dir))
                           (setq fn34 (open (strcat :Y340_DWG: a-dir "/" "¹w³]µL®ÄÀÉ®×.dwg") "w"))
                           (close fn34)
                           (:Y340-36:)
)   )     ))   )   )   )


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;  §R°£¥Ø¿ý  >>>>>>

(Defun Dos_Deltree (Folder / FiL Rtn subf sf)
    (cond ((vl-file-directory-p Folder)
           (if (null (setq FiL (vlax-get-or-create-object "Scripting.FileSystemObject")))
               (setq Rtn nil)
               (progn
                   (cond ((<= (strlen Folder) 3)
                          (if (= (strlen folder) 2)
                              (setq folder (strcat folder "\\")) )
                          (setq subf (vl-directory-files Folder nil -1)
                                subf (vl-remove "." subf)
                                subf (vl-remove ".." subf)
                                subf (vl-remove "Recycled" subf) )
                          (foreach sf subf (vlax-invoke-method FiL 'DeleteFolder (strcat folder sf) T)) )
                         ( T (vlax-invoke-method FiL 'DeleteFolder Folder T)) )
                   (vlax-release-object FiL)
                   (setq Rtn (not (vl-file-directory-p Folder)))
          ))   )
          ((findfile Folder)
           (vl-file-delete folder)
           (setq Rtn (not (findfile Folder)))
)   ) Rtn )


(defun :Y340-35: (/ d-dir dd35)
    (if (not (new_dialog "Y340F" dcl_id)) (exit)) ;; Y340F ¥²¶·¤j¼g
    (set_tile "d-dir" y340_fname1)
    (action_tile "accept" "(done_dialog 1)")
    (action_tile "cancel" "(setq d-dir nil) (done_dialog 0)")
    (setq dd35 (start_dialog))
    (cond ((= dd35 1)
           (Dos_Deltree (strcat :Y340_DWG: y340_fname1))
           (:Y340-36:)
)   )     )


(defun :Y340-36: ()
    (:Y340-11:)                                   ;; ¦^Âkªì©l­È³]©w
    (setq d_list-1 (Dos_subdir :Y340_DWG:)) (:Y340-9:) ;; ­«¸m"¥Ø¿ý"
    (setq lst1_z (- (length d_list-1) 1))         ;; ¥Ø¿ý¤U¹ÏÀɼƶq
    (:Y340-22: num1 d_list-1) )  ;; ­«¸m¥Ø¿ý¦WºÙ»PBLOCKÀɮצWºÙ¦Cªí


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;  ¤j¹Ï¹wÄý  >>>>>>

(defun :Y340-41: (/ dd2)
    (mode_tile (strcat "im" (itoa y340_stch)) 4)
    (if (not (new_dialog "Y340A" dcl_id)) (exit)) ;; Y340A ¥²¶·¤j¼g
    (:Y340-42:) ;; Åã¥Ü³æ±i¤Û¿O¤ù³]©w
    (:Y340-44:) ;; ²H¤ÆÅã¥Ü"¤W¤@±i"&"¤U¤@±i"

    (action_tile "s-beg" "(:Y340-43: 1)")   ;; ²Ä¤@±i
    (action_tile "s-end" "(:Y340-43: 2)")   ;; ³Ì¥½±i
    (action_tile "s-pre" "(:Y340-45: 1)")   ;; ¤W¤@±i
    (action_tile "s-net" "(:Y340-45: 2)")   ;; ¤U¤@±i
    (action_tile "back"  "(done_dialog 0)") ;; ¦^«e­¶
    (action_tile "sinst" "(done_dialog 6)") ;; BLOCK´¡¤J

    ;; ³]©wªð¦^¤Û¿O¤ù¿ï¨ú­¶­±®É¡Aºû«ù©M¤j¹Ï¹wÄý®É¬Û¦PÀÉ®×
    (setq y340_stch (+ (fix fname) 1))

    (setq dd2 (start_dialog))
    (cond ((= dd2 0) (:Y340-3:) (:Y340-26:))
          ((= dd2 6) (done_dialog 5))) ) ;; °õ¦æBLOCK´¡¤J


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;  Åã¥Ü³æ±i¤Û¿O¤ù³]©w  >>>>>>

(defun :Y340-42: (/ sld-list1 key-list1)
    (setq sld-list1 '())
    (setq y340_ui (nth (fix fname) d_data-2))

    (if dirdwg
        (setq sld-list1 (list (strcat spath "/" y340_ui ".sld")))
        (setq sld-list1 (list (strcat :Y340_DWG: y340_fname1 "/" y340_ui ".sld"))) )
    (setq key-list1 '("s_image"))
    (mapcar ':show-sld: key-list1 sld-list1)

    (set_tile "bpath2" bpath) ;; Åã¥ÜBLOCK¥Ø¿ý¸ô®|
    (set_tile "bfile" (strcat "<< " y340_ui ".dwg >>")) ;; Åã¥ÜBLOCKÀɦW
    (:Y340-44:) ) ;; ²H¤ÆÅã¥Ü"¤W¤@±i"&"¤U¤@±i"


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;  ¤j¹Ï¹wÄý_¦^²Ä¤@±i & ¦Ü³Ì¥½±i  >>>>>>

(defun :Y340-43: (ch6)
    (cond ((= ch6 1) (setq fname 0))        ;; Åã¥Ü²Ä¤@±i¤Û¿O¤ù
          ((= ch6 2) (setq fname lst2_z)) ) ;; Åã¥Ü³Ì¥½±i¤Û¿O¤ù
    (setq y340_stch (+ (fix fname) 1))
    (:Y340-42:) ) ;; ­«¸m³æ±i¤Û¿O¤ù


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;  ¤j¹Ï¹wÄý_²H¤Æ/Åã¥Ü"¤W¤@±i"&"¤U¤@±i"  >>>>>>

(defun :Y340-44: ()
    (cond ((= fname 0)
           (mode_tile "s-beg" 1) (mode_tile "s-end" 0)
           (mode_tile "s-pre" 1) (mode_tile "s-net" 0) )
          ((= fname lst2_z)
           (mode_tile "s-beg" 0) (mode_tile "s-end" 1)
           (mode_tile "s-pre" 0) (mode_tile "s-net" 1) )
          ((or (/= fname 0) (/= fname lst2_z))
           (mode_tile "s-beg" 0) (mode_tile "s-end" 0)
           (mode_tile "s-pre" 0) (mode_tile "s-net" 0))) )


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;  ¤j¹Ï¹wÄý_¤W¤@±i & ¤U¤@±i  >>>>>>

(defun :Y340-45: (ch7)
    (cond ((= ch7 1) (setq fname (- fname 1)))   ;; Åã¥Ü¤W¤@±i¤Û¿O¤ù
          ((= ch7 2) (setq fname (+ fname 1))) ) ;; Åã¥Ü¤U¤@±i¤Û¿O¤ù
    (setq y340_stch (+ (fix fname) 1))
    (:Y340-42:) ) ;; ­«¸m³æ±i¤Û¿O¤ù


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;  Åã¥Ü¹Ï¼h¿ï³æ  >>>>>>

(defun :Y340-81: ()
    (setq obj (tblnext "layer" t))
    (setq lay_list '())
    (while (/= obj nil)
        (setq str81 (cdr (assoc 2 obj)))
        (setq lay_list (cons str81 lay_list))
        (setq obj (tblnext "layer")))
    (setq lay_list (reverse lay_list))
    (start_list "p_lay")
    (mapcar 'add_list lay_list)
    (end_list) )


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;  ³]©w¹Ï¼h¹Ï¥Ü  >>>>>>

(defun :Y340-82: (value)
    (set_tile "p_lay" value)
    (setq lay (nth (atoi value) lay_list)) ;; lay_list ¹ïÀ³ :Y340-81:
    (setq y340_image lay) ;; °õ¦æ«e¤@¦¸¹Ï¼h¹Ï¥Ü«ü©w¹Ï¼h
    (setq y340_lay value) ;; °õ¦æ«e¤@¦¸¹Ï¼h¿ï³æ«ü©w¹Ï¼h
    (:Y340-83:) )

(defun :Y340-83: (/ lay_dd)
    (setq lay_dd (tblsearch "layer" lay))
    (setq colorstr (itoa (1- (cdr (assoc 62 lay_dd)))))
    (:Y340-84: colorstr) )

(defun :Y340-84: (cnum / cnum1 x y)
   (setq cnum1 (1+ (atoi cnum)))
   (setq x (dimx_tile "layer_image"))
   (setq y (dimy_tile "layer_image"))
   (start_image "layer_image")
   (fill_image 0 0 x y cnum1)
   (end_image) )


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;  Åã¥Ü¤Û¿O¤ù  >>>>>>

(defun :show-sld: (key sld / x y)
    (setq x (dimx_tile key))
    (setq y (dimy_tile key))
    (start_image key)
    (fill_image  0 0 x y -2)
    (slide_image 0 0 x y sld)
    (end_image)
)
(princ)

 

Edited by CADTutor
Moved code to code block

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...