28.10.2009 11:57    

smyrna15
slm... ya ben foruma, download bölümüne falan hep baktım belki vardır ama aradığımı bulamadım,valla başım döndü, can havliyle bi sorayım dedim, şöyle ki; ben çelik konstrüksiyon imalat resimleri çiziyorum ve doğal olarak poz no veriyorum imalatlarıma, halka içinde P1 den başlayarak gidiyo işte... angarya oluyor çok... baktım harfsiz numaralandırma var site de harflide var ama ben böyle var olan bi texti tıklamadan yani direk bir objeyi gösterdiğimde halka içinde P1 yazacak bişey arıyorum, aks isimlerinde oldugu gibi yani... mümkünmü acaba böyle birşey? müsait olduğunda yazabilirmisin yada eğer var da ben göremediysem linkini verebilirmisin o sayfanın???
teşekkürlerrr...

28.10.2009 14:38    

ehya
Komut ismi YY

Kod:

(defun y:yazi:islem ()
  (vl-load-com)
  (setq pn_ActDoc (vla-get-ActiveDocument (vlax-get-Acad-Object)))
  (setq pn_StyListe (vla-get-TextStyles pn_ActDoc))
  (setq pn_StyObj (vl-catch-all-error-p '(vla-item pn_StyListe "D-YAZI")))
  (if (= pn_StyObj nil)
    (progn
      (setq style (vla-add (vla-get-textstyles pn_ActDoc) "D-YAZI"))
        (vla-put-fontfile style "simplex.shx")
        (vla-put-height style 0)
        (vla-put-obliqueangle style 0.0)
        (vla-put-width style 1)
        (vla-put-textgenerationflag style 0.0)
    )
    (progn
      (setq yyuk-sor (vla-get-height pn_StyObj))
      (if (/= yyuk-sor 0.0)
(progn
  (vla-put-Height pn_StyObj 0)
)
      )
    )
  )
)
(defun c:yy ()
  (y:yazi:islem)
  (vl-load-com)
  (setvar "errno" 0)
  (setq nnil nil)
  (while (= nnil nil)
    (progn
      (setq yy_ent (entsel "\nDaireyi seçin:"))
      (if (= yy_ent nil)
(progn
  (if (= (getvar "errno") 7)
    (progn
      (setq nnil nil)
    )
  )
  (if (= (getvar "errno") 52)
    (progn
      (setq nnil t)
    )
  )
)
(progn
  (setq yy:data (vlax-ename->vla-object (car yy_ent)))
  (if (/= (vla-get-objectname yy:data) "AcDbCircle")
    (progn
      (princ "\nSeçilen nesne Daire değil...!!!")
      (setq nnil nil)
    )
    (progn
      (setq yy:ycap (vla-get-radius yy:data))
      (setq yy:merk
     (vlax-safearray->list
       (vlax-variant-value (vla-get-center yy:data))
     )
      )
      (setvar "textstyle" "D-YAZI")
      (setq y:yaz_bakalim
     (vla-addtext
       (if
(= 1 (vla-get-activespace pn_ActDoc))
  (vla-get-modelspace pn_ActDoc)
  (if (= (vla-get-mspace pn_ActDoc)
:vlax-true
      )
    (vla-get-modelspace pn_ActDoc)
    (vla-get-paperspace pn_ActDoc)
  )
       )
       "P1"
       (vlax-3d-point yy:merk)
       yy:ycap
     )
      )
      (setq lll '(10 10 0))
      (vla-put-alignment y:yaz_bakalim acalignmentmiddlecenter)
      (vla-put-textalignmentpoint
y:yaz_bakalim
(vla-get-center yy:data)
      )
    )
  )
)
      )
    )
  )
  (setvar "errno" 52)
  (princ)
)

ehya (29.10.2009 09:40 GMT)

29.10.2009 16:47    

fox
autocad içersinde vardı böyle bişey ama şuan hatırlayamadım yarın bakmam gerekir.

30.10.2009 18:27    

ProhibiT
Merhaba smyrna15 :)
İstediğiniz işlemi en basit, en kısa ve en kullanışlı şekilde yapmak üzere bir kaç satır yazdım. Umarım işinize yarar...
Kod:

(defun C:POZ ()
   (setvar "cmdecho" 0)
   (command "undo" "group")
   (if (= 0 (getvar "useri5")) (setq esayi 1) (setq esayi (- (getvar "useri5") 1)))
   (setq sayi (getint (strcat "\nBaslangic Poz Numarası <" (strcat "P" (itoa esayi)) "> :")))
   (if (= sayi nil) (setq sayi esayi))
   (if (= eyuk nil) (setq eyuk (* (getvar "dimtxt") (getvar "dimscale"))))
   (setq yyuk (getreal (strcat "\nYazi yuksekligi <" (rtos eyuk) "> :")))
   (if (= yyuk nil) (setq yyuk eyuk))
   (if (setq ynok (getpoint "\nilgili noktayi seciniz..."))
      (while ynok
         (command "text" "m" ynok yyuk 0 (strcat "P" (itoa sayi)))
         (command "circle" ynok (* 1.5 yyuk))
         (setq sayi (1+ sayi) ynok (getpoint "\nYeni nokta seciniz......"))
      )
      (exit)
   )
   (setq eyuk yyuk)
   (setvar "useri5" (1+ sayi))
   (command "undo" "e")
   (prin1)
)

İstediğiniz gibi pozlandırma yapar. Ara verip başka işlemler yaptıktaa sonra tekrar devam etmek istediğinizde kaldığı son poz numarasını unutmaz. Çizim dosyasını kapatıp yeniden açsanız bile son kaldığı poz numarasını hatırlar...

Selamlar, Sevgiler, Herkese Kolay Gelsin...

ProhibiT (31.10.2009 03:13 GMT)

19.11.2009 07:00    

alirizasahin
kalorifer ve sıhhi tesisat kolon adlandırmalarında da çok rahat kullanabileceğim bir lisp emeği geçen arkadaşlara teşekkürler

19.11.2009 09:50    

miyatu
Alıntı
ProhibiT :
Merhaba smyrna15 :)
İstediğiniz işlemi en basit, en kısa ve en kullanışlı şekilde yapmak üzere bir kaç satır yazdım. Umarım işinize yarar...
Kod:

(defun C:POZ ()
   (setvar "cmdecho" 0)
   (command "undo" "group")
   (if (= 0 (getvar "useri5")) (setq esayi 1) (setq esayi (- (getvar "useri5") 1)))
   (setq sayi (getint (strcat "\nBaslangic Poz Numarası <" (strcat "P" (itoa esayi)) "> :")))
   (if (= sayi nil) (setq sayi esayi))
   (if (= eyuk nil) (setq eyuk (* (getvar "dimtxt") (getvar "dimscale"))))
   (setq yyuk (getreal (strcat "\nYazi yuksekligi <" (rtos eyuk) "> :")))
   (if (= yyuk nil) (setq yyuk eyuk))
   (if (setq ynok (getpoint "\nilgili noktayi seciniz..."))
      (while ynok
         (command "text" "m" ynok yyuk 0 (strcat "P" (itoa sayi)))
         (command "circle" ynok (* 1.5 yyuk))
         (setq sayi (1+ sayi) ynok (getpoint "\nYeni nokta seciniz......"))
      )
      (exit)
   )
   (setq eyuk yyuk)
   (setvar "useri5" (1+ sayi))
   (command "undo" "e")
   (prin1)
)

İstediğiniz gibi pozlandırma yapar. Ara verip başka işlemler yaptıktaa sonra tekrar devam etmek istediğinizde kaldığı son poz numarasını unutmaz. Çizim dosyasını kapatıp yeniden açsanız bile son kaldığı poz numarasını hatırlar...

Selamlar, Sevgiler, Herkese Kolay Gelsin...




o useri5 ler fena karisacak haberin olsun :)

emegine saglik guzel bir calisma olmus...

02.08.2010 17:55    

piscopatos
merhabalar Sayın ProhibiT hocam,
öncelikle emeklerinizden dolayı teşekkür ederim,
acaba bu yazdığınız lisp'isadece P1,P2 ... şeklinde değilde P yerine istediğiz harfi yazabileceğimiz şekilde düzenleyebilirmisiniz?

03.08.2010 06:15    

ProhibiT
Merhaba piscopatos,
İstediğiniz değişikliği fonksiyona ekledim. Bunu yapmışken bazı kavramları da değiştiriverdim.
Text ve Circle için (command... yerine (entmake... kullandım
Kod:

;===============================================================
;   Seçilen bir harf veya harf gurubuyla başlayan ve artarak   
;   devam eden sırada, çember içine alınmış Poz numarası       
;   vermek için Hazırlayan: Mehmet Sahin Guvercin               
;                         sahinguvercin@hotmail.com             
;===============================================================
(defun C:POZ ()
  (setvar "cmdecho" 0) (command "undo" "group")
  (if esayi (setq sayi esayi) (setq esayi 1))
  (if (= epre nil) (setq epre "P"))
  (if (= eyuk nil) (setq eyuk (* (getvar "dimtxt") (getvar "dimscale"))))
  (setq pre (getstring (strcat "\Poz'ların başına gelecek Harf ya da Harf Gurubu <" epre ">: ")))
  (if (= pre "") (setq pre epre)) (if (= pre "0") (setq pre ""))
  (setq sayi (getint (strcat "\nBaslangic Poz Numarası <" (itoa esayi) "> :")))
  (if (= sayi nil) (setq sayi esayi))
  (setq yyuk (getreal (strcat "\nYazi yuksekligi <" (rtos eyuk) "> :")))
  (if (= yyuk nil) (setq yyuk eyuk))
  (while (setq ynok (getpoint (strcat "\n<" pre (itoa sayi) "> Pozu için Yer seciniz...")))
    (entmake (list (cons 0 "TEXT") (cons 1 (strcat pre (itoa sayi))) (cons 10 ynok) (cons 11 ynok)
                   (cons 40 yyuk) (cons 72 4)))
    (setq a1 (entget (entlast)) p1 (car (textbox a1)) p2 (cadr (textbox a1))
          rad (* 0.575 (distance p1 p2)))
    (entmake (list (cons 0 "CIRCLE") (cons 10 ynok) (cons 40 rad)))
    (setq sayi (1+ sayi)))
  (setq eyuk yyuk esayi sayi epre pre) (command "undo" "e") (prin1)
)

Drawing dosyasından çıkılıncaya kadar,
-Poz Numarası
-Başa gelen Harf (veya Harf Gurubu)
-Yazı Yüksekliği
Unutulmaz... dosyadan çıkılınca hepsi unutulur

Çizilen çember çapı sabit değildir. Başa gelen Harf ve Poz Numarasının uzunluğuna bağlı olarak çember çapı değiştirilir.

Poz numaralarının başına bir harf veya seçeceğiniz karakter gurubunu girebilirsiniz.

Eğer Poz'un başına herhangi bir şey gelmesini istemiyorsanız bu soruya 0 (sıfır) girerek cevap veriniz.

Kolay gelsin...

ProhibiT (14.12.2010 14:01 GMT)

03.08.2010 13:23    

bud_0782
teşekkürler...

03.08.2010 17:24    

piscopatos
teşekkürlerle sayın ProhibiT hocam, ellerinize sağlık

19.08.2010 07:56    

alirizasahin
Prohibit arkadaşımızın lisp biz makinacıların çok işine yarayacaktır. Teşekkürler emeğin ve paylaşımın için,

30.11.2010 09:30    

odrcmn
Emeğiniz için teşekkürler.

Saygılarımla

06.05.2011 19:14    

arincakkin
Sayın arkadaslar ve editorler. ön ek son ek orta yaıyı ayrı ayrı girebileceğiniz ve hangisinin değişken artan olarak belirleyebileceğiniz harflerin de değişken olabildiği, yazılanların istenirse kare, daire,veye istenilen sayıda kenarları olan çokgen çerçevelerle belirlenebildiği bir lisp paylaşıyorum. bu başlığa uygun olacağını düşündüm.

komutu: numinc
Kod:

;;;¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,;;;
;;;ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,¤º°`°º¤;;;
;;                                                                               ;;
;;                                                                               ;;
;;                  --=={  ıncremental numbering suite  }==--                    ;;
;;                                                                               ;;
;;  will sequentially generate numerical text upon mouse click, with optional    ;;
;;  prefix and suffix.                                                           ;;
;;                                                                               ;;
;;  [ Enter ]            ~      Exit Program                                     ;;
;;  [ < ]                ~      Rotate Text CCW                                  ;;
;;  [ > ]                ~      Rotate Text CW                                   ;;
;;  [ Tab ]              ~      Rotate Text by 90º                               ;;
;;  [ Shift + Tab ]      ~      Mirror Text Rotation (requires Express Tools)    ;;
;;  [ C ]                ~      Align Text to Curve                              ;;
;;  [ R ]                ~      Replace Existing Text/Attribute String           ;;
;;  [ T ]                ~      Toggle Counter Increment                         ;;
;;  [ B ]                ~      Rotate Polygonal Border                          ;;
;;                                                                               ;;
;;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=;;
;;                                                                               ;;
;;  FUNCTION SYNTAX:  NumInc                                                     ;;
;;                                                                               ;;
;;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=;;
;;                                                                               ;;
;;  AUTHOR:                                                                      ;;
;;                                                                               ;;
;;  Copyright © Lee McDonnell, April 2009. All Rights Reserved.                  ;;
;;                                                                               ;;
;;      { Contact: Lee Mac @ TheSwamp.org, CADTutor.net }                        ;;
;;                                                                               ;;
;;                                                                               ;;
;;                  ___      _______  _______                                    ;;
;;                 /\  \    /\  ____\/\  ____\                                   ;;
;;                 \ \  \   \ \ \___/\ \ \___/_                                  ;;
;;                  \ \  \   \ \  ____\ \  ____\                                 ;;
;;                   \ \  \___\ \ \___/\ \ \___/_                                ;;
;;                    \ \______\ \______\ \______\                               ;;
;;                     \/______/\/______/\/______/                               ;;
;;                      ___________  ________  _______                           ;;
;;                     /\   _   _  \/\   __  \/\   ___\                          ;;
;;                     \ \  \\  \\  \ \  \_\  \ \  \__/                          ;;
;;                      \ \  \\  \\  \ \   __  \ \  \                            ;;
;;                       \ \  \\  \\  \ \  \ \  \ \  \____                       ;;
;;                        \ \__\\__\\__\ \__\ \__\ \______\                      ;;
;;                         \/__//__//__/\/__/\/__/\/______/                      ;;
;;                                                                               ;;
;;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=;;
;;                                                                               ;;
;;  VERSION:                                                                     ;;
;;                                                                               ;;
;;  ø 1.0  ~¤~     12th April 2009  ~¤~   º First Release.                       ;;
;;...............................................................................;;
;;  ø 1.1  ~¤~     14th April 2009  ~¤~   º Added Prefix/Suffix Option.          ;;
;;...............................................................................;;
;;  ø 1.2  ~¤~     15th April 2009  ~¤~   º Added Dialog.                        ;;
;;...............................................................................;;
;;  ø 1.3  ~¤~     15th April 2009  ~¤~   º Added Option to Replace Existing     ;;
;;                                          text/attribute string.               ;;
;;...............................................................................;;
;;  ø 1.4  ~¤~     18th April 2009  ~¤~   º Made program compatible with leading ;;
;;                                          zeros.                               ;;
;;...............................................................................;;
;;  ø 1.5  ~¤~      16th June 2009  ~¤~   º Upgraded program code.               ;;
;;...............................................................................;;
;;  ø 1.6  ~¤~      27th June 2009  ~¤~   º Added Counter Toggle.                ;;
;;                                        º General Bug Fixes.                   ;;
;;...............................................................................;;
;;  ø 1.7  ~¤~  18th February 2010  ~¤~   º General Program Upgrade.             ;;
;;...............................................................................;;
;;  ø 1.8  ~¤~  19th February 2010  ~¤~   º Change Rotation Controls.            ;;
;;...............................................................................;;
;;  ø 1.9  ~¤~  22nd February 2010  ~¤~   º Added option to not use GrRead loop, ;;
;;                                          and hence allow OSnap to function.   ;;
;;                                        º Added ability to place text in Table ;;
;;                                          Cells.                               ;;
;;...............................................................................;;
;;  ø 2.0  ~¤~  24th February 2010  ~¤~   º Fixed Text Height Bug.               ;;
;;...............................................................................;;
;;  ø 2.1  ~¤~        5th May 2010  ~¤~   º Removed imitation OSnap.             ;;
;;                                        º Modified loop to allow multiple      ;;
;;                                          replacements when in standard mode.  ;;
;;                                        º Added ability to use Alphabetical    ;;
;;                                          Increment.                           ;;
;;...............................................................................;;
;;  ø 2.2  ~¤~        6th May 2010  ~¤~   º Fixed bug with text case when        ;;
;;                                          incrementing alphabetical strings.   ;;
;;                                        º Added ability to border text with    ;;
;;                                          either Circle, Rectangle or Slot;    ;;
;;                                          and offset from text.                ;;
;;...............................................................................;;
;;  ø 2.3  ~¤~        7th May 2010  ~¤~   º Changed the way that layer/style     ;;
;;                                          globals are stored to allow for      ;;
;;                                          layer/style changes between uses.    ;;
;;                                        º Removed Xref layers/styles from      ;;
;;                                          list.                                ;;
;;                                        º Fixed UCS bugs.                      ;;
;;...............................................................................;;
;;  ø 2.4  ~¤~       10th May 2010  ~¤~   º Added a 'By Style' option for text   ;;
;;                                          height selection.                    ;;
;;                                        º Added option to enclose text with    ;;
;;                                          n-sided Polygon.                     ;;
;;                                        º Added ability to rotate polygonal    ;;
;;                                          border.                              ;;
;;...............................................................................;;
;;  ø 2.5  ~¤~       11th May 2010  ~¤~   º Allowed for Zero height in           ;;
;;                                          TextStyle.                           ;;
;;                                        º Added ability to fix border size.    ;;
;;                                        º Fixed Text Height variable bug.      ;;
;;                                        º Fixed Rotation of odd-sided          ;;
;;                                          polygons.                            ;;
;;...............................................................................;;
;;  ø 2.6  ~¤~       12th May 2010  ~¤~   º Fixed Rotation of odd-sided polygons ;;
;;                                          when text is not set to follow       ;;
;;                                          cursor.                              ;;
;;                                        º Fixed Slot Bulges.                   ;;
;;                                        º Added 'B' control to DCL About page. ;;
;;...............................................................................;;
;;  ø 2.7  ~¤~       22nd May 2010  ~¤~   º Fixed Border issue when in different ;;
;;                                          view.                                ;;
;;...............................................................................;;
;;  ø 2.8  ~¤~       24th May 2010  ~¤~   º Changed DCL/CFG file save path to    ;;
;;                                          make program compatible with         ;;
;;                                          Bricscad.                            ;;
;;...............................................................................;;
;;  ø 2.9  ~¤~       29th May 2010  ~¤~   º Upgraded code to determine DCL/CFG   ;;
;;                                          Filepath, to allow for AutoCAD       ;;
;;                                          Versions pre 2004.                   ;;
;;...............................................................................;;
;;                                                                               ;;
;;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=;;
;;                                                                               ;;
;;;¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,;;;
;;;ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,¤º°`°º¤;;;


(defun c:NumInc
       

;.................................................................................;
       

  (/

     ;;         --=={ Local Functions }==--          ;

     *error*
     ADDCIRCLE ADDCLOSEDLWPOLY
     BOXTEXT BOXTOG
     DCL_WRITE
     GETBOUNDINGBOX GETLEN
     INCREMENTALPHA ITEMP
     LOGO
     MAKE_LIST MAKESAFEARRAYVARIANT
     NEST_INFO
     POPUP
     READ_CONFIG ROTATEBYMATRIX
     SIZETOG
     TRANSLATEBYMATRIX
     WRITE_CONFIG
     
     ;;         --=={ Local Variables }==--          ;

     *ACAD *ADOC
     ALPHA
     BFIXED BOFF BOXOFF BOXTYPE BROT
     C CANG CFGFNAME CIR$ CODE COL CTOGG CUR_MODE
     DATA DCFLAG DCFNAME DCTAG DCTITLE DXLST
     ENT EOBJ EXIT_FLAG EXPRESS
     FIXED
     GR GRFLAG
     HGT HGT$
     I INC ISBOXED
     L LANG LAST$ LAYERS
     MSG
     NINC NOFF NORM NPER NSIDE
     OFILE OV
     P P$ PLACES POS POSFLAG PREF PT PTLST
     R RAD REPFLAG REP_MODE RMSG ROT ROTFLAG ROW
     SANG SAVEPATH SIDE SIDES SINC SMID SPC STR STR_LEN STYLES STYPE SUFF
     TABLEFOUND TABLES TBYSTY THGT TI TOBJ TSS TSTR
     UFLAG
     VALUE VERSIONNUMBER VL
     XANG

     ;;         --=={ Global Variables }==--          ;

     ; LAY:DEF STYL:DEF BOX:LAY

   )

  (vl-load-com)

  ;; Lee Mac  ~  12.04.09

 
  ;;;¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,;;;

  ;;                           --=={  Preliminaries  }==--                         ;;

  ;;;¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,;;;
 

  (setq VersionNumber "2.9")

  ;.................................................................................;

  (setq SavePath

    (cond
     
      ( (setq tmp (getvar 'ROAMABLEROOTPREFIX))

        (or (eq "" (substr tmp (strlen tmp)))
            (setq tmp (strcat tmp "")))

        (strcat tmp "Support")
      )
      ( (setq tmp (findfile "ACAD.pat"))

        (setq tmp (vl-filename-directory tmp))

        (or (eq "" (substr tmp (strlen tmp)))
            (setq tmp (strcat tmp "")))
       
        tmp
      )
      (t
        (popup "Warning" 16 "DCL Save Path not Valid")

        (exit)
      )
    )
  )
 
  ;.................................................................................;

  (setq dcfname    (strcat SavePath "LMAC_NumInc_V" VersionNumber ".dcl")

        cfgfname   (strcat SavePath "LMAC_NumInc_V" VersionNumber ".cfg")

        dctitle    (strcat "Number Increment V" VersionNumber))

  ;.................................................................................;

  (setq *acad (vlax-get-acad-object)
        *adoc (vla-get-ActiveDocument *acad)

        spc   (if
                (or
                  (eq acModelSpace (vla-get-ActiveSpace *adoc))
                  (eq :vlax-true   (vla-get-MSpace *adoc))
                )
                (vla-get-ModelSpace *adoc)
                (vla-get-PaperSpace *adoc)
              )
  )

  (vlax-for lay (vla-get-Layers *adoc)
    (setq layers
      (cons
        (vla-get-Name lay) layers
      )
    )
  )

  (vlax-for sty (vla-get-TextStyles *adoc)
    (setq styles
      (cons
        (vla-get-Name sty) styles
      )
    )
  )

  (setq layers (acad_strlsort
                 (vl-remove-if
                   (function
                     (lambda ( layer )
                       (wcmatch layer "*|*")
                     )
                   )
                   layers
                 )
               )
        styles (acad_strlsort
                 (vl-remove-if
                   (function
                     (lambda ( style )
                       (wcmatch style "*|*")
                     )
                   )
                   (vl-remove "" styles)
                 )
               )
  )
 
  (setq Express
    (and
      (vl-position "acetutil.arx" (arx))
      (not
        (vl-catch-all-error-p
          (vl-catch-all-apply
            (function
              (lambda nil
                (acet-sys-shift-down)
              )
            )
          )
        )
      )
    )
  )
 
  ;;;¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,;;;

  ;;                           --=={  Local Functions  }==--                       ;;

  ;;;¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,;;;
 
  (defun *error* ( msg )
   
    (and tObj (not (vlax-erased-p tObj))
      (vla-delete tObj))

    (and eObj (not (vlax-erased-p eObj))
      (vla-delete eObj))

    (and cir$ (entdel cir$))

    (and uFlag (vla-EndUndoMark *adoc))

    (and ofile (eq 'file (type ofile)) (close ofile))
   
    (if ov (mapcar (function setvar) vl ov))

    (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")
        (princ (strcat "\n** Error: " msg " **")))
   
    (redraw)
    (princ)
  ) 

  ;.................................................................................;

  (defun write_config ( fname lst / ofile )

    (if (setq ofile (open fname "w"))
      (progn
       
        (foreach x lst
          (write-line (vl-prin1-to-string x) ofile))
       
        (setq ofile (close ofile))

        t
      )
    )
  )

  ;.................................................................................;

  (defun read_config  ( fname lst / ofile )

    (if (and (setq fname (findfile fname))
             (setq ofile (open fname "r")))
      (progn

        (foreach x lst
          (set x
            (read
              (read-line ofile)
            )
          )
        )
        (setq ofile (close ofile))

        lst
      )
    )
  )

  ;.................................................................................;

  (defun MakeSafearrayVariant ( typ val )
    (vlax-make-variant
      (vlax-safearray-fill
        (vlax-make-safearray (eval typ)
          (cons 1
            (length val)
          )
        )
        val
      )
    )
  )

  ;.................................................................................;

  (defun AddClosedLWPoly ( block lst / o )
    (vla-put-Closed
      (setq o
        (vla-AddLightWeightPolyline block
          (MakeSafearrayVariant vlax-VbDouble
            (apply (function append)
              (mapcar
                (function
                  (lambda ( x )
                    (list (car x) (cadr x))
                  )
                )
                lst
              )
            )
          )
        )
      )
      :vlax-true
    )
    o
  )

  ;.................................................................................;

  (defun AddCircle ( block cen rad )
    (vla-AddCircle block
      (vlax-3D-point cen) rad
    )
  )

  ;.................................................................................;

  (defun GetBoundingBox ( ll ur o / data )
    (
      (lambda ( data )
        (mapcar
          (function
            (lambda ( funcs )
              (mapcar
                (function
                  (lambda ( func )
                    (
                      (eval func) data
                    )
                  )
                )
                funcs
              )
            )
          )
         '(
            (
              (lambda (x) (- (caar   x) o))
              (lambda (x) (- (cadar  x) o))
            )
            (
              (lambda (x) (+ (caadr  x) o))
              (lambda (x) (- (cadar  x) o))
            )
            (
              (lambda (x) (+ (caadr  x) o))
              (lambda (x) (+ (cadadr x) o))
            )
            (
              (lambda (x) (- (caar   x) o))
              (lambda (x) (+ (cadadr x) o))
            )
          )
        )
      )
      (list ll ur)
    )     
  )

  ;.................................................................................;

  (defun RotateByMatrix ( obj pt ang / RotationMatrix Vector row )
   
    (setq RotationMatrix
      (list
        (list (cos ang) (- (sin ang))  0.0)
        (list (sin ang)    (cos ang)   0.0)
        (list    0.0           0.0     1.0)
      )
    )

    (setq Vector
      (mapcar (function -) pt
        (mapcar
          (function
            (lambda ( row )
              (apply (function +)
                (mapcar (function *) row pt)
              )
            )
          )
          RotationMatrix
        )
      )
    )
   
    (vla-transformby obj
      (vlax-tmatrix
        (append
          (mapcar
            (function
              (lambda ( r x )
                (append r (list x))
              )
            )
            RotationMatrix Vector
          )
         '((0.0 0.0 0.0 1.0))
        )
      )
    )
  )

  ;.................................................................................;

  (defun TranslateByMatrix ( obj p1 p2 / TranslationMatrix V )

    (setq V (mapcar (function -) p2 p1))

    (setq TranslationMatrix
      (list
        (list 1.0 0.0 0.0 (car   V))
        (list 0.0 1.0 0.0 (cadr  V))
        (list 0.0 0.0 1.0 (caddr v))
        (list 0.0 0.0 0.0    1.0   )
      )
    )

    (vla-transformby obj
      (vlax-tmatrix TranslationMatrix)
    )
  )

  ;.................................................................................;

  (defun BoxText ( block obj offset mode side fixd / ll ur bb p c cpy r ptlst sAng rad tb r org )

    (setq tb (textbox (entget (vlax-vla-object->ename obj))))
    (setq bb (GetBoundingBox (car tb) (cadr tb) offset)
           r (vla-get-rotation obj))
   
    (cond
      (
        (or (eq "1" Mode) (eq "2" Mode))

        (RotateByMatrix
          (setq p
            (AddClosedLWPoly block bb)
          )
          '(0. 0. 0.) r
        )

        (TranslateByMatrix p '(0. 0. 0.) (vlax-get obj 'InsertionPoint))

        (if (= "2" Mode)
          (mapcar
            (function
              (lambda ( v )
                (vla-SetBulge p v 1.)
              )
            )
            '(1 3)
          )
        )
        p
      )
      (
        (eq "0" Mode)
       
        (AddCircle block
          (vlax-get obj 'TextAlignmentPoint)
          (cond
            (
              Fixd
            )
            (
              (distance (car bb)
                (mapcar
                  (function
                    (lambda ( x y ) (/ (+ x y) 2.))
                  )
                  (car bb) (caddr bb)
                )
              )
            )
          )
        )
      )
      (side
       
        (setq sAng (/ (* 2 pi) side))

        (setq rad
          (cond
            (
              Fixd
            )
            (
              (setq rad
                (distance (car bb)
                  (mapcar
                    (function
                      (lambda ( x y ) (/ (+ x y) 2.))
                    )
                    (car bb) (caddr bb)
                  )
                )
              )
              (/ rad
                (cos
                  (/ sAng 2.)
                )
              )
            )
          )
        )

        (setq c (vlax-get obj 'TextAlignmentPoint))

        (
          (lambda ( k )
            (repeat side
              (setq ptlst
                (cons
                  (polar c
                    (* (setq k (1+ k)) sAng) rad
                  )
                  ptlst
                )
              )
            )
          )
          -1
        )

        (RotateByMatrix
          (setq p (AddClosedLWPoly block ptLst)) c r
        )
        p
      )
    )
  )

  ;.................................................................................;

  (defun Popup ( title flags msg / WSHShell result )
   
    (setq WSHShell (vlax-create-object "WScript.Shell"))
    (setq result   (vlax-invoke WSHShell 'Popup msg 0 title flags))
    (vlax-release-object WSHShell)

    result
  )

  ;.................................................................................;

  (defun Make_List (key lst)
   
    (start_list key)
    (mapcar (function add_list) lst)
    (end_list)
  )
 
  ;.................................................................................;

  (defun Getlen  (txt inc_dec / Strl dec_pos decs dec)
   
    (setq Strl (strlen txt))
   
    (setq decs
      (if (setq dec_pos (vl-string-position 46 txt))
        (- Strl dec_pos 1)
        0
      )
    )
   
    (setq dec (max inc_dec decs))
   
    (cond
      (
        (and (> decs 0) (> inc_dec 0))

        (setq Strl (+ dec_pos dec 1))
      )
      (
        (and (= decs 0) (> inc_dec 0))

        (setq Strl (+ inc_dec 1 Strl))
      )
    )
   
    (list dec Strl)
  )
 
  ;.................................................................................;

  (defun Itemp ( coll item )
    (if
      (not
        (vl-catch-all-error-p
          (setq item
            (vl-catch-all-apply
              (function vla-item) (list coll item)
            )
          )
        )
      )
      item
    )
  )
 
  ;.................................................................................;

  (defun IncrementAlpha ( str i / Alpha2Number Number2Alpha pos l )

    (setq pos
      (
        (lambda ( i )
          (vl-remove 'nil
            (mapcar
              (function
                (lambda ( x )
                  (setq i (1+ i)) (if (< 90 x) i)
                )
              )
              (reverse
                (vl-string->list str)
              )
            )
          )
        )
        -1
      )
    )           

    (defun Alpha2Number ( str / n ) ; Gile
      (if (= 0 (setq n (strlen str)))
        0
        (+ (* (- (ascii (strcase (substr str 1 1))) 64) (expt 26 (1- n)))
           (Alpha2Number (substr str 2))
        )
      )
    )


    (defun Number2Alpha ( n / r )  ; Gile
      (if (< n 27)
        (chr (+ 64 n))
        (if (= 0 (setq r (rem n 26)))
          (strcat (Number2Alpha (1- (/ n 26))) "Z")
          (strcat (Number2Alpha (/ n 26)) (chr (+ 64 r)))
        )
      )
    )

    (setq l
      (vl-string->list
        (Number2Alpha
          (+ (Alpha2Number str) i)
        )
      )
    )

    (vl-list->string
      (
        (lambda ( i )
          (mapcar
            (function
              (lambda ( x )
                (if (and (vl-position (setq i (1- i)) pos)
                         (<= 65 x 90))
                  (+ x 32)
                  x
                )
              )
            )
            l
          )
        )
        (length l)
      )
    )
  )

  ;.................................................................................;

  (defun logo ( key )
   
    (start_image key)
    (mapcar 'vector_image
            '(22 21 1 0 0 0 0 7 0 0 0 0 1 6 6 6 6 7 43 36 27 36 30 21 21 21 22 22 22
              22 21 21 21 28 28 28 27 27 30 29 29 30 52 43 43 43 44 44 46 46 45 45 45
              45 52 52 52 51 51 51 51 51 52 62 65 66 68 68 68 68 67 67 75 75 75 74 74
              73 66 58 58 59 59 59 59 52 57 57 56 56 56 56 57 58 65 65 65 65 66 95 94
              94 92 91 91 91 90 89 89 88 87 86 85 74 74 75 75 76 77 78 79 80 81 82 83
              84 85 86 87 88 88 89 90 91 92 93 94 95 74 73 73 72 72 71 71 71 71 71 71
              71 72 72 72 73 84 83 82 81 80 79 79 78 77 77 76 76 76 76 76 77 77 78 79
              79 80 81 82 83 94 94 95 83 83 82 81 80 79 78 77 76 75 74 84 85 86 87 88
              89 89 90 91 91 91 91 92 95 94 93 92 91 90 89 89 88 87 86 85 84)

            '(20 20 23 23 23 24 24 0 0 0 0 1 1 20 1 1 1 0 2 24 7 15 0 0 0 0 1 1 23 23
              23 24 24 24 24 24 23 23 2 1 1 0 0 0 0 0 1 1 7 23 23 23 24 24 24 24 24 23
              23 1 1 1 0 10 16 19 21 22 23 24 24 24 24 24 24 23 23 22 4 4 5 5 6 6 7 24
              24 24 24 23 23 22 19 16 7 7 6 5 5 22 22 22 17 17 18 18 19 20 20 20 21 21
              21 21 22 23 23 23 24 24 24 25 25 25 25 25 25 25 25 24 24 24 23 23 22 22
              22 22 7 8 8 9 10 11 12 13 14 15 16 17 18 19 19 20 21 21 21 21 20 20 19 19
              18 17 16 15 14 13 12 12 11 10 9 9 8 8 8 7 7 7 7 4 4 4 4 4 4 4 5 5 6 6 7 7
              8 8 8 9 9 9 10 11 11 11 11 7 7 7 6 6 5 5 4 4 4 4 4 4)

            '(21 6 0 0 0 0 21 0 0 0 0 1 1 6 6 6 7 7 36 46 36 30 21 21 21 22 22 22 22 21
              21 21 28 28 28 27 27 27 29 29 30 30 43 43 43 44 44 43 46 45 45 45 45 52 52
              52 51 51 51 51 51 52 52 65 58 68 68 68 68 67 67 75 75 75 74 74 73 65 58 58
              59 59 59 59 51 57 57 56 56 56 56 57 66 62 65 65 65 66 66 94 94 95 91 91 91
              90 89 89 88 87 86 85 84 74 75 75 76 77 78 79 80 81 82 83 84 85 86 87 88 88
              89 90 91 92 93 94 95 92 73 73 72 72 71 71 71 71 71 71 71 72 72 72 73 74 83
              82 81 80 79 79 78 77 77 76 76 76 76 76 77 77 78 79 79 80 81 82 83 84 94 95
              94 83 82 81 80 79 78 77 76 75 74 74 85 86 87 88 89 89 90 91 91 91 91 92 95
              94 93 92 91 90 89 89 88 87 86 85 84 83)

            '(20 20 23 23 24 24 24 0 0 0 1 1 23 1 1 1 0 0 15 7 24 2 0 0 0 1 1 23 23 23 24
              24 24 24 24 23 23 7 1 1 0 0 0 0 0 1 1 2 23 23 23 24 24 24 24 24 23 23 1 1 1
              0 0 16 16 21 22 23 24 24 24 24 24 24 23 23 22 7 4 5 5 6 6 7 22 24 24 24 23
              23 22 19 19 10 7 6 5 5 4 22 22 22 17 18 18 19 20 20 20 21 21 21 21 22 23 23
              23 24 24 24 25 25 25 25 25 25 25 25 24 24 24 23 23 22 22 22 22 17 8 8 9 10 11
              12 13 14 15 16 17 18 19 19 20 21 21 21 21 20 20 19 19 18 17 16 15 14 13 12 12
              11 10 9 9 8 8 8 7 7 7 7 7 4 4 4 4 4 4 5 5 6 6 7 7 8 8 8 9 9 9 10 11 11 11 11
              7 7 7 6 6 5 5 4 4 4 4 4 4 4)

            '(178 178 178 178 178 178 178 178 178 178 178 178 178 178 178 178 178 178 178
              178 178 178 178 178 178 178 178 178 178 178 178 178 178 178 178 178 178 178
              178 178 178 178 178 178 178 178 178 178 178 178 178 178 178 178 178 178 178
              178 178 178 178 178 178 178 178 178 178 178 178 178 178 178 178 178 178 178
              178 178 178 178 178 178 178 178 178 178 178 178 178 178 178 178 178 178 178
              178 178 178 178 178 178 178 178 178 178 178 178 178 178 178 178 178 178 178
              178 178 178 178 178 178 178 178 178 178 178 178 178 178 178 178 178 178 178
              178 178 178 178 178 178 178 178 178 178 178 178 178 178 178 178 178 178 178
              178 178 178 178 178 178 178 178 178 178 178 178 178 178 178 178 178 178 178
              178 178 178 178 178 178 178 178 178 178 178 178 178 178 178 178 178 178 178
              178 178 178 178 178 178 178 178 178 178 178 178 178 178 178 178 178 178 178
              178 178 178 178 178 178 178 178 178))
   
  (end_image))

  ;.................................................................................;
 
  (defun dcl_write ( fname / ofile )

    (if (not (findfile fname))

      (if (setq ofile (open fname "w"))
        (progn

          (foreach str

            '(
              "//;¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,;//"
              "//;ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,¤º°`°º¤;//"
              "//                                                                               //"
              "//                                                                               //"
              "//                   --=={  Incremental Numbering Suite  }==--                   //"
              "//                                                                               //"
              "//  NumInc.dcl to be used in conjunction with NumInc.lsp.                        //"
              "//                                                                               //"
              "//  Copyright © Lee McDonnell, April 2009. All Rights Reserved.                  //"
              "//                                                                               //"
              "//                                                                               //"
              "//;¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,;//"
              "//;ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,¤º°`°º¤;//"
              ""
              ""
              "//  --=={ Sub-Assembly Definitions }==--"
              ""
              "edit5 : edit_box     { edit_width = 5; alignment = centered; fixed_width = true;  }"
              " ctxt : text         { alignment  = centered;                                     }"
              "but12 : button       { width = 12;   fixed_width = true; alignment = centered;    }"
              " but7 : button       { width =  7.4; fixed_width = true; alignment = left;        }"
              "  rad : radio_button { alignment = centered;                                      }"
              "title : text         { alignment = centered; is_bold = true; fixed_width = false; }"
              "  txt : text         { alignment = centered; fixed_width = false;                 }"
              " ltxt : text         { alignment = left;     fixed_width = false;                 }"
              ""
              ""
              "//;¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,;//"
              ""
              "                        //  --=={ Main Dialog Definition }==--  //"
              ""
              "//;¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,;//"
              ""
              ""
              "Num : dialog { key = "dctitle";"
              ""
              "  spacer;"
              ""
              "  : row {"
              ""
              "    : column {"
              ""
              "      : toggle { alignment = left; key = "grflag"; label = "Text Follows Cursor"; }"
              ""
              "    }"
              ""
              "    : column {"
              ""
              "      : text   { label = "Copyright (c) 2009 Lee McDonnell"; alignment = right; }"
              ""
              "    }"
              ""
              "  }"
              ""
              "  spacer;"
              ""
              "  : row {"
              "  "
              "    : boxed_column { label = "Increment Format";"
              "    "
              "      : row {"
              ""
              "        spacer;"
              ""
              "        : edit5 { key = "pref_str"; }"
              "        : edit5 { key = "mid_str";  }"
              "        : edit5 { key = "suff_str"; }"
              ""
              "        spacer;"
              "        "
              "      }"
              ""
              "      : row {"
              ""
              "        spacer_1;"
              ""
              "        : ctxt { label = "Prefix"; }"
              "        : ctxt { label = "Middle"; }"
              "        : ctxt { label = "Suffix"; }"
              ""
              "      }"
              ""
              "      spacer;"
              ""
              "      : edit5 { label = "Increment: "; key = "inc_str"; }"
              "      spacer;"
              ""
              "      : boxed_column { label = "Section to Increment";"
              ""
              "        : row {"
              ""
              "          : rad { label = "Prefix"; key = "sel_pref"; }"
              "          : rad { label = "Middle"; key = "sel_mid";  }"
              "          : rad { label = "Suffix"; key = "sel_suff"; }"
              ""
              "        }"
              ""
              "        spacer;"
              "        "
              "      }"
              ""
              "      spacer;"
              ""
              ""
              "      : boxed_column { label = "Border Options";"
              ""
              "      spacer;"
              ""
              "        : toggle     { key = "enclose"; label = "Enclose Text with: "; }"
              ""
              "        : row {"
              ""
              "          : popup_list { key = "type"; }"
              ""
              "          : edit_box { alignment = left; edit_width = 5; fixed_width = true;"
              "                       key = "sides"; label = "Sides:"; }"
              ""
              "        }"
              ""
              "        spacer;"
              ""
              "        : boxed_column { label = "Border Size";"
              ""
              "          : row {"
              ""
              "            : radio_column { "
              ""
              "              : radio_button { key = "otype"; label = "  Offset:"; }"
              ""
              "              : radio_button { key = "ftype"; label = "   Fixed:"; }"
              ""
              "              spacer;"
              ""
              "            }"
              ""
              "            : column {"
              ""
              "              : edit5 { key = "off"   ; }"
              ""
              "              : edit5 { key = "fixed_edit" ; }"
              ""
              "              spacer;"
              ""
              "            }"
              ""
              "            : column {"
              ""
              "              : but7   { height = 3.5; fixed_height = true;"
              "                         key = "fixed_pick"; label = ">>"; }"
              ""
              "            }"
              ""
              ""
              "          }"
              ""
              "          spacer;"
              ""
              "        }"
              ""
              "      spacer;"
              ""
              "      }"
              ""
              "    spacer;"
              ""
              "    }"
              ""
              "    : boxed_column { label = "Formatting";"
              ""
              "      spacer;"
              ""
              "      : text { label = "Text Layer: "; }"
              "      : popup_list { key = "text_lay"; }"
              ""
              "      spacer;"
              ""
              "      : text { label = "Border Layer: "; }"
              "      : popup_list { key = "bord_lay";}"
              ""
              "      spacer;"
              ""
              "      : text { label = "Text Style: "; }"
              "      : popup_list { key = "text_styl";}"
              ""
              "      spacer;"
              ""
              "      : boxed_column { label = "Text Height";"
              ""
              "        : row {"
              ""
              "          : toggle { key = "tbysty"; label = "By Style"; }"
              ""
              "          : column {"
              ""
              "            : edit5  { key = "text_size"; }"
              ""
              "            spacer;"
              "            "
              "          }"
              ""
              "        }"
              ""
              "        spacer;"
              "        "
              "      }"
              ""
              "      spacer;"
              ""
              "      : image { key = "logo"; alignment = centered;"
              "                width = 16.06 ; fixed_width  = true;"
              "                height = 2.06 ; fixed_height = true; color = -15; }"
              ""
              "    }"
              ""
              "  }"
              ""
              "  : errtile { width = 34; }"
              ""
              "  spacer;"
              ""
              "  : row {"
              ""
              "    spacer;"
              ""
              "    : but12 { key = "accept"; label = "OK";    is_default = true; }"
              "    : but12 { key = "info";   label = "About"; }"
              "    : but12 { key = "cancel"; label = "Cancel"; is_cancel = true; }"
              ""
              "    spacer;"
              "    "
              "  }"
              ""
              "  spacer;"
              ""
              "}"
              ""
              ""
              "//;¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,;//"
              ""
              "                      //  --=={ 'About' Dialog Definition }==--  //"
              ""
              "//;¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,;//"
              ""
              ""
              "Info : dialog { label = "About";"
              "  spacer;"
              "  "
              "  : title { label = "¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸"; }"
              "  : title { label = "   =-=-=-=-=-=-=-=-=-=-={ NumInc.lsp }-=-=-=-=-=-=-=-=-=-=  "     ; }"
              "  : title { label = "`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸,ø¤º°" ; }"
              "  "
              "  spacer;"
              "  "
              "  : title { label = "--={  Copyright (c) 2009, by Lee McDonnell  }=--" ; }"
              "  "
              "  spacer;"
              "  "
              "  : ltxt { label = "Program Controls:" ; }"
              "  "
              "  spacer;"
              "  "
              "  : row { fixed_width = true; alignment = centered;"
              "  "
              "    : column {"
              ""
              "       : txt { label = "["     ; }"
              "       : txt { label = "["     ; }"
              "       : txt { label = "["     ; }"
              "       : txt { label = "["     ; }"
              "       : txt { label = "["     ; }"
              "       : txt { label = "["     ; }"
              "       : txt { label = "["     ; }"
              "       : txt { label = "["     ; }"
              "       : txt { label = "["     ; }"
              "    }"
              "     "
              "    : column {"
              ""
              "       : txt { label = "ENTER"        ; }"
              "       : txt { label = "<"            ; }"
              "       : txt { label = ">"            ; }"
              "       : txt { label = "TAB"          ; }"
              "       : txt { label = "SHIFT + TAB"  ; }"
              "       : txt { label = "C"            ; }"
              "       : txt { label = "R"            ; }"
              "       : txt { label = "T"            ; }"
              "       : txt { label = "B"            ; }"
              "    }"
              "     "
              "    : column {"
              ""
              "       : txt { label = "]"     ; }"
              "       : txt { label = "]"     ; }"
              "       : txt { label = "]"     ; }"
              "       : txt { label = "]"     ; }"
              "       : txt { label = "]"     ; }"
              "       : txt { label = "]"     ; }"
              "       : txt { label = "]"     ; }"
              "       : txt { label = "]"     ; }"
              "       : txt { label = "]"     ; }"
              "    }"
              "     "
              "    spacer;"
              "    "
              "    : column {"
              "      : ltxt { label = "Exit Program"                              ; }"
              "      : ltxt { label = "Rotate Text Counter-Clockwise"             ; }"
              "      : ltxt { label = "Rotate Text Clockwise"                     ; }"
              "      : ltxt { label = "Rotate Text by 90º"                        ; }"
              "      : ltxt { label = "Mirror Text Rotation"                      ; }"
              "      : ltxt { label = "Align Text to Curve"                       ; }"
              "      : ltxt { label = "Replace Existing Text/Attribute String"    ; }"
              "      : ltxt { label = "Toggle Increment Counter"                  ; }"
              "      : ltxt { label = "Rotate Polygonal Border"                   ; }"
              "      "
              "    }"
              "    "
              "  }"
              "  "
              "  spacer_1;"
              "  : title { label = "`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸,ø¤º°" ; }"
              "  spacer_1;"
              "  "
              "  ok_cancel;"
              "  "
              "}"
              ""
              ""
              "//;¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,;//"
              "//                                                                               //"
              "//                           End of Dialog Definition                            //"
              "//                                                                               //"
              "//;ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,¤º°`°º¤;//"

              )

           (write-line str ofile))
         
        (setq ofile (close ofile))
         
        t)  ; File written successfully
       
    nil) ; File not Opened
     
  t)) ; DCL file already exists

  ;.................................................................................;

  (defun nest_info ( tag )

    (cond
      (
        (not (new_dialog "Info" Tag "(done_dialog)"))

        (Popup "Warning" 16 "The 'About' Dialog could not be Loaded")
        (princ "\n** DCL could not be Loaded **")
      )
      (t
        (start_dialog)
      )
    )
  )

  ;.................................................................................;

  (defun BoxTog ( value )

    (mapcar
      (function
        (lambda ( tile )
          (mode_tile tile
            (if (zerop (atoi value))
               1 0
            )
          )
        )
      )
      '("type" "off" "bord_lay" "otype" "fixed_pick")
    )

    (mapcar
      (function
        (lambda ( tile value )
          (mode_tile tile value)
        )
      )
     '("fixed_edit" "ftype")
      (if (and (= "1" value) (vl-position BoxType '("0" "3")))
        '(0 0 0)
        '(1 1 1)
      )
    )     
   
    (mode_tile "sides"
      (if (and (= "1" value) (= "3" BoxType)) 0 1)
    )
   
    value
  )

  ;.................................................................................;

  (defun SizeTog nil
    (
      (lambda ( lst )
        (mapcar
          (function mode_tile) '("off" "fixed_edit") lst
        )
      )
      (if (eq "1" isBoxed)
        (if (vl-position BoxType '("0" "3"))
          (progn
            (mode_tile "ftype" 0)
            (if (eq "otype" sType)
              '(0 1)
              '(1 0)
            )
          )
          (progn
            (set_tile (setq sType "otype") "1")
            (mode_tile "ftype" 1)
           '(0 1)
          )
        )
       '(1 1)
      )
    )
  )

  ;.................................................................................;

  ;;;¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,;;;

  ;;                           --=={  Main Function  }==--                         ;;

  ;;;¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,;;;


  ;;  ¤º°`°º¤ø,¸¸,ø¤º°`°º¤  --=={  Setup Defaults  }==--  ¤º°`°º¤ø,¸¸,ø¤º°`°º¤

  (setq vl '("DIMZIN" "MODEMACRO" "OSMODE" "CMDECHO") ov (mapcar (function getvar) vl))
  (setvar "DIMZIN"  3)
  (setvar "CMDECHO" 0)

  (or
    (findfile cfgfname)
    (write_config cfgfname
      (list
        "1"        ; Middle
        "1"        ; Increment
        ""         ; Prefix
        ""         ; Suffix
        "sel_mid"  ; Section to Increment
        (/ pi 2.)  ; Perpendicularity
        1.0        ; Offset Factor
        (vl-princ-to-string
          (vla-get-Height
            (Itemp (vla-get-TextStyles *adoc)
              (getvar 'TEXTSTYLE)
            )
          )
        )          ; Text Height
        "1"        ; Text Height By Style
        "1"        ; GrRead Flag
        "0"        ; Boxed Text
        "0"        ; Boxed Type
        "0.0"      ; Boxed Offset
        "6"        ; Sides
        "otype"    ; Border Size Type
        "1.0"      ; Fixed Size
       )
     )
   )

  (read_config cfgfname
   '(sMid
     nInc
     Pref
     Suff
     sInc
     nPer
     nOff
     tHgt
     tbysty
     grFlag
     isBoxed
     BoxType
     BoxOff
     Sides
     SType
     Fixed
    )
  )
 
  (or sMid    (setq sMid         "1"))
  (or nInc    (setq nInc         "1"))
  (or Pref    (setq Pref          ""))
  (or Suff    (setq Suff          ""))
  (or sInc    (setq sInc   "sel_mid"))
  (or nPer    (setq nPer   (/ pi 2.)))
  (or nOff    (setq nOff         1.0)) 
  (or tHgt    (setq tHgt   (vl-princ-to-string
                             (vla-get-Height
                               (Itemp (vla-get-TextStyles *adoc)
                                 (getvar 'TEXTSTYLE)
                               )
                             )
                           )
              )
  )
  (or tbysty  (setq tbysty       "1"))
 
  (or grFlag  (setq grFlag       "1"))
  (or isBoxed (setq isBoxed      "0"))
  (or BoxType (setq BoxType      "0"))
  (or BoxOff  (setq BoxOff     "0.0"))
  (or Sides   (setq Sides        "6"))
  (or SType   (setq SType    "otype"))
  (or Fixed   (setq Fixed      "1.0"))
 

  (or
    (and  lay:def (vl-position lay:def layers))
    (setq lay:def (getvar 'CLAYER))
  )

  (or
    (and  box:lay (vl-position box:lay layers))
    (setq box:lay (getvar 'CLAYER))
  )

  (or
    (and  styl:def (vl-position styl:def styles))
    (setq styl:def (getvar 'TEXTSTYLE))
  )

  (if (setq ti -1 tss (ssget "_X" '((0 . "ACAD_TABLE"))))
    (while
      (setq ent
        (ssname tss
          (setq ti (1+ ti))
        )
      )
      (setq Tables
        (cons
          (vlax-ename->vla-object ent) Tables
        )
      )
    )
  )

  (setq norm (trans '(0. 0. 1.) 1 0 t)
        xAng (angle '(0. 0. 0.) (trans (getvar 'UCSXDIR) 0 norm)))
 

  ;;  ¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤
 

  (cond (  (= 4 (logand 4 (cdr (assoc 70 (tblsearch "LAYER" (getvar "CLAYER"))))))

           (popup "Warning" 16 "Current Layer Locked")
           (princ "\n** Current Layer Locked **"))

        (  (not (DCL_Write dcfname))

           (Popup "Warning" 16 "Dialog Definition File could not be Written")
           (princ "\n** DCL File Could not be Written **"))

        (  (<= (setq dcTag (load_dialog dcfname)) 0)

           (Popup "Warning" 16 "Dialog Definition File could not be Found")
           (princ "\n** DCL File could not be Found **"))

        (t

           (while (not (vl-position dcFlag '(1 0)))

             (cond
               (
                 (not (new_dialog "Num" dcTag))

                 (Popup "Warning" 16 "The Incremental Numbering Suite Dialog could not be Loaded")
                 (princ "\n** DCL could not be Loaded **")

                 (setq dcFlag 0)
               
               )
               (t

                 (mapcar (function Make_List) '("text_lay" "bord_lay" "text_styl")
                   (list layers layers styles)
                 )

                 (Make_List "type" '("Circle" "Rectangle" "Slot" "Polygon"))

                 (mapcar (function set_tile)
                         '("pref_str"   "mid_str"   "suff_str"
                           "inc_str"    "text_size" "text_lay"
                           "text_styl"  "type"      "off"
                           "enclose"    "bord_lay"  "tbysty"
                           "sides"      "fixed_edit"
                          )

                         (list Pref
                               sMid
                               Suff
                               nInc
                               tHgt
                               (itoa (vl-position  lay:def layers))
                               (itoa (vl-position styl:def styles))
                               BoxType
                               BoxOff
                               isBoxed
                               (itoa (vl-position  box:lay layers))
                               tbysty
                               Sides
                               Fixed
                         )
                 )

                 (set_tile sType "1")                 

                 (set_tile "dctitle" dctitle)

                 (Logo "logo")

                 (BoxTog isBoxed)

                 (SizeTog)
               
                 (set_tile sInc "1")
                 (set_tile "grflag" grFlag)

                 (mode_tile "text_size" (atoi tbysty))

                 (if
                   (zerop
                     (setq Hgt$
                       (vla-get-Height
                         (Itemp
                           (vla-get-TextStyles *adoc) styl:def
                         )
                       )
                     )
                   )
                   (progn
                     (mode_tile "text_size"
                       (atoi
                         (setq tbysty
                           (set_tile "tbysty" "0")
                         )
                       )
                     )
                     (mode_tile "tbysty" 1)
                   )
                   (progn
                     (mode_tile "tbysty" 0)
                     (if (= 1 (mode_tile "text_size" (atoi tbysty)))
                       (setq tHgt
                         (set_tile "text_size"
                           (vl-princ-to-string Hgt$)
                         )
                       )
                     )
                   )
                 )

                 (action_tile  "sel_pref"   "(setq sInc "sel_pref" )")
               
                 (action_tile  "sel_mid"    "(setq sInc "sel_mid"  )")
               
                 (action_tile  "sel_suff"   "(setq sInc "sel_suff" )")

                 (action_tile  "otype"      "(setq SType "otype") (SizeTog)")

                 (action_tile  "ftype"      "(setq SType "ftype") (SizeTog)")

                 (action_tile  "fixed_pick" "(done_dialog 2)")

                 (mapcar
                   (function
                     (lambda ( key symbol )
                       (action_tile key
                         (strcat "(setq " symbol " $value)")
                       )
                     )
                   )
                  '("inc_str"   "pref_str"
                    "mid_str"   "suff_str"
                    "text_size" "grflag"
                    "off"       "sides"
                    "fixed_edit"
                   )
                  '("nInc"      "Pref"
                    "sMid"      "Suff"
                    "tHgt"      "grFlag"
                    "BoxOff"    "Sides"
                    "Fixed"
                   )
                 )

                 (action_tile "text_lay"   "(setq lay:def  (nth (atoi $value) layers))")

                 (action_tile "type"
                   (vl-prin1-to-string
                     (quote
                       (progn
                         (mode_tile "sides"
                           (if (eq "3" (setq BoxType $value)) 0 1)
                         )
                         (SizeTog)
                       )
                     )
                   )
                 )

                 (action_tile "text_styl"
                   (vl-prin1-to-string
                     (quote
                       (progn
                         (setq styl:def (nth (atoi $value) styles))

                         (if
                           (zerop
                             (setq Hgt$
                               (vla-get-Height
                                 (Itemp
                                   (vla-get-TextStyles *adoc) styl:def
                                 )
                               )
                             )
                           )
                           (progn
                             (mode_tile "text_size"
                               (atoi
                                 (setq tbysty
                                   (set_tile "tbysty" "0")
                                 )
                               )
                             )
                             (mode_tile "tbysty" 1)
                           )
                           (progn
                             (mode_tile "tbysty" 0)
                             (if (= 1 (mode_tile "text_size" (atoi tbysty)))
                               (setq tHgt
                                 (set_tile "text_size"
                                   (vl-princ-to-string Hgt$)
                                 )
                               )
                             )
                           )
                         )
                       )
                     )
                   )
                 )                   

                 (action_tile "bord_lay"   "(setq box:lay  (nth (atoi $value) layers))")

                 (action_tile "enclose"
                   (vl-prin1-to-string
                     (quote
                       (progn
                         (if (eq "1" (BoxTog (setq isBoxed $value)))
                           (SizeTog)
                         )
                       )
                     )
                   )
                 )

                 (action_tile "tbysty"
                   (vl-prin1-to-string
                     (quote
                       (progn
                         (mode_tile "text_size" (atoi (setq tbysty $value)))

                         (if (eq "1" tbysty)
                           (setq tHgt
                             (set_tile "text_size"
                               (vl-princ-to-string
                                 (vla-get-Height
                                   (Itemp
                                     (vla-get-TextStyles *adoc) styl:def
                                   )
                                 )
                               )
                             )
                           )
                         )
                       )
                     )
                   )
                 )               

                 (action_tile  "info"      "(nest_info dcTag)")
                 (action_tile  "cancel"    "(done_dialog 0)")

                 (action_tile  "accept"
                   (vl-prin1-to-string
                     (quote
                       (progn

                         (and (eq "" nInc) (setq nInc "0.0"))
                         (and (eq "" tHgt) (setq tHgt (vl-princ-to-string
                                                        (getvar "TEXTSIZE"))))

                         (if (setq inDec (vl-string-position 46 nInc))
                           (setq inDec (- (strlen nInc) inDec 1))
                           (setq inDec 0))

                         (setq Alpha (or (and (eq "sel_pref" sInc) (not (distof Pref)))
                                         (and (eq "sel_mid"  sInc) (not (distof sMid)))
                                         (and (eq "sel_suff" sInc) (not (distof Suff)))))
                         

                         (cond (  (and (eq "otype" sType) (not (setq bFixed nil))
                                       (not (setq bOff (distof BoxOff))))

                                  (set_tile "error" "Border Offset not Numerical!"))

                               (  (and (eq "ftype" sType) (setq bOff 0.0)
                                       (not (setq bFixed (distof Fixed))))

                                  (set_tile "error" "Border Size not Numerical!"))
                           
                               (  (not (setq Inc (distof nInc)))

                                  (set_tile "error" "Increment not Numerical!"))

                               (  (not (setq Hgt (distof tHgt)))

                                  (set_tile "error" "Text Height not Numerical!"))

                               (  (<= Hgt 0)

                                  (set_tile "error" "Text Height must be Positive!"))

                               (  (and (eq "3" BoxType) (< (setq nSide (atoi Sides)) 3))

                                  (set_tile "error" "No. Sides must be Numerical and > 2"))

                               (t

                                  (and Alpha (setq Inc (fix Inc)))
                               
                                  (setq posFlag  (vl-position sInc '("sel_pref" "sel_mid" "sel_suff"))

                                        Str_data (GetLen (nth posFlag (list Pref sMid Suff)) inDec))

                                  (setq places (car Str_data) Str_len (cadr Str_data))

                                  (done_dialog 1)))))))
               

                 (cond
                   (
                     (= 2 (setq dcFlag (start_dialog)))

                     (if (eq "ftype" sType)
                       
                       (if
                         (and (setq p$ (getpoint "\nPick Point: "))
                           (progn
                             (setq last$ (entlast))
                             (princ
                               (strcat "\nPick Border Radius"
                                 (if (zerop (getvar 'CIRCLERAD)) ": "
                                   (strcat
                                     " <" (rtos (getvar 'CIRCLERAD)) "> : "
                                   )
                                 )
                               )
                             )
                             (vl-cmdf "_.circle" p$ pause)
                             (not
                               (equal last$
                                 (setq cir$
                                   (entlast)
                                 )
                               )
                             )
                           )
                         )
                         (progn
                           (setq Fixed
                             (rtos
                               (cdr
                                 (assoc 40
                                   (entget cir$)
                                 )
                               )
                             )
                           )
                           (entdel cir$)
                           (setq cir$ nil)
                           (redraw)
                         )
                       )
                       (if (setq d$ (getdist "\nSpecify Offset: "))
                         (setq BoxOff (rtos d$))
                       )
                     )
                   )
                 )
               )
             )
           )
             
           (setq dcTag  (unload_dialog dcTag))

           (setq bRot
             (if
               (and nSide
                 (= 1
                   (boole 1 1 nSide)
                 )
               )
               (/ pi 2.)
               0.0               
             )
           )

          ;.................................................................................;

           (if (= 1 dcflag)
             (progn

               (or Alpha
                 (
                   (lambda (x)                 
                     (set x (rtos (distof (eval x)) 2 places))
                 
                     (while (< (strlen (eval x)) Str_Len)
                       (set x (strcat (chr 48) (eval x)))))

                 (nth posFlag '(Pref sMid Suff)))
               )

               (setq rot 0.0)

               (cond (  (eq "1" grFlag)

                        ;; Program doesn't work too well with NODE/INSERTION Snap enabled

                        (setvar "OSMODE" (boole 2 (getvar "OSMODE") 72))
               
                        (princ
                          (setq msg
                            (strcat "\n[C]urve Aligned, [<] Rotate CCW, [>] Rotate CW, [T]oggle Count"
                                    (if (eq "3" BoxType) ", Rotate [B]order" "")
                                    "\n[Tab] = Rotate 90, [Shift] + [Tab] = Mirror Rotation, [R]eplace,  < Exit >")))
                       
                        ;..............................................................................

ehya (07.05.2011 07:38 GMT)

10.05.2019 08:25    

ozkanavcioglu
Arkadaşlar merhaba bu konuda benim de başım belada bu autocad de poz olayı büyük sorun ve pek anlamıyorum yukarıda ki yazdıklarınız hakkında biraz daha açıklayıcı olur musunuz bi kaç lisp yazılmış hangisini nasıl kullanacagım

> 1 <
Copyright © 2004-2022 SQL: 1.516 saniye - Sorgu: 80 - Ortalama: 0.01895 saniye