tfanghui 发表于 2022-7-18 17:08:40

自动建立图层并指定图层名称、颜色、线型 、线宽

本帖最后由 tfanghui 于 2022-7-19 14:10 编辑

借鉴明经大神的建图层,自动建立图层 指定图层名称、颜色、线型 、线宽。朋友们可以根据自己工作习惯修改。

小毛草 发表于 2022-7-26 17:38:53

;;;自动创建常用图层
(defun c:FFF ()
(setvar "cmdecho" 0)
(command "layer" "m" "DOTE""c" "1" "" "l" "DOTE" """")
(command "layer" "m" "WALL" "c" "42" "" "")
(command "layer" "m" "A-ELEV-LIN1-立面外轮廓线" "c" "42" "" "")
(command "layer" "m" "A-ELEV-LIN2-立面中轮廓线" "c" "2" "" "")
(command "layer" "m" "A-ELEV-LIN3-立面细轮廓线" "c" "153" "" "")
(command "layer" "m" "A-ELEV_OTHER-立面配景" "c" "153" "" "")
(command "layer" "m" "0-PM-固定家具" "c" "251" "" "")
(command "layer" "m" "0-PM-建筑面积计算" "c" "6" "" "")
(command "layer" "m" "DOOR" "c" "4" "" "")
(command "layer" "m" "DOOR-NAME" "c" "5" "" "")
(command "layer" "m" "大样剖切线" "c" "4" "" "")
(command "layer" "m" "WALL" "c" "42" "" "")
(command "layer" "m" "A-FURN-绘图层" "c" "2" "" "")
(command "layer" "m" "PUB_WINDW" "c" "7" "" "")
(command ".layer" "p" "p" "PUB_WINDW" "")
(command "layer" "m" "A-FURN-绘图层" "c" "2" "" "")
(command "-style" "ZG" "TXT1.shx,HZTXT1.shx" "" "0.7" "" "" "" "N")
(command "-style" "黑体" "黑体" "" "0.7" "" "" "")
(command ".layer" "p" "p" "PUB_WINDW" "")
(setvar "cmdecho" 1)
(princ)
)

;;;自动创建常用总图图层
(defun c:FFA ()
(setvar "cmdecho" 0)
(command "layer" "m" "0-总图-建筑红线" "c" "1" "" "l" "PHANTOM" """")
(command "layer" "m" "0-总图-用地红线""c" "6" "" "l" "DOTE" """")
(command "layer" "m" "DOTE""c" "1" "" "l" "DOTE" """")
(command "layer" "m" "WALL" "c" "42" "" "")
(command "layer" "m" "0-总图-道路红线" "c" "2" "" "")
(command "layer" "m" "0-总图-道路边线" "c" "3" "" "")
(command "layer" "m" "0-总图-道路中心线" "c" "1" "" "l" "CENTER" """")
(command "layer" "m" "0-总图-建筑外边线" "c" "42" "" "")
(command "layer" "m" "0-总图-建筑可视线" "c" "2" "" "")
(command "layer" "m" "0-总图-已建建筑外边线" "c" "190" "" "")
(command "layer" "m" "0-总图-围墙线" "c" "221" "" "")
(command "layer" "m" "0-总图-构筑物" "c" "6" "" "")
(command "layer" "m" "0-总图-园林植物" "c" "251" "" "")
(command "layer" "m" "0-总图-表格线" "c" "3" "" "")
(command "layer" "m" "0-总图-园林布置" "c" "2" "" "")
(command "layer" "m" "0-总图-摩托车位" "c" "6" "" "")
(command "layer" "m" "0-总图-非机车位" "c" "6" "" "")
(command "layer" "m" "0-总图-绿地面积" "c" "6" "" "")
(command "layer" "m" "0-总图-绿化树" "c" "251" "" "")   
(command "layer" "m" "0-总图-小汽车停车位" "c" "6" "" "")
(command "layer" "m" "PUB_WINDW" "c" "7" "" "")
(command ".layer" "p" "p" "PUB_WINDW" "")
(command "layer" "m" "A-FURN-绘图层" "c" "2" "" "")
(command "-style" "ZG" "TXT1.shx,HZTXT1.shx" "" "0.7" "" "" """N")
(command "-style" "黑体" "黑体" "" "0.7" "" "" "")
(command ".layer" "p" "p" "PUB_WINDW" "")
(setvar "cmdecho" 1)
(princ)
)

;;;自动创建装修常用图层
(defun c:FFG ()
(setvar "cmdecho" 0)
(command "layer" "m" "0-TF-天花布置" "c" "2" "" "")
(command "layer" "m" "0-FURN-平面图" "c" "2" "" "")
(command "layer" "m" "0-TF-天花灯具布置" "c" "6" "" "")
(command "layer" "m" "0-TF-天花尺寸标注" "c" "3" "" "")
(command "layer" "m" "0-DM-地面填充" "c" "251" "" "")
(command "layer" "m" "0-DM-地坪分割线" "c" "251" "" "")
(command "layer" "m" "0-DM-门槛线" "c" "251" "" "")
(command "layer" "m" "0-DM-地面尺寸标注" "c" "3" "" "")
(command "layer" "m" "0-FURN-平面布置图" "c" "2" "" "")
(command "layer" "m" "0-FURN-平面尺寸" "c" "2" "" "")
(command "layer" "m" "0-PM-固定家具" "c" "251" "" "")
(command "layer" "m" "DOOR" "c" "4" "" "")
(command "layer" "m" "DOTE""c" "1" "" "l" "DOTE" """")
(command "layer" "m" "DOOR-NAME" "c" "4" "" "")
(command "layer" "m" "WALL" "c" "42" "" "")
(command "layer" "m" "大样剖切线" "c" "4" "" "")
(command "layer" "m" "PUB_WINDW" "c" "7" "" "")
(command ".layer" "p" "p" "PUB_WINDW" "")
(command "layer" "m" "A-FURN-绘图层" "c" "2" "" "")
(command "-style" "ZG" "TXT1.shx,HZTXT1.shx" "" "0.7" "" "" """N")
(command "-style" "黑体" "黑体" "" "0.7" "" "" "")
(command ".layer" "p" "p" "PUB_WINDW" "")
(setvar "cmdecho" 1)
(princ)
)

;;通过命令设换到相应天花图层
(defun c:T1() (setvar "clayer" "0-TF-天花布置") (princ))
(defun c:T2() (setvar "clayer" "0-TF-天花尺寸标注") (princ))
(defun c:T3() (setvar "clayer" "0-TF-天花灯具布置") (princ))


;;通过命令设换到相应地面图层
(defun c:D1() (setvar "clayer" "0-DM-地面填充") (princ))
(defun c:D2() (setvar "clayer" "0-DM-地面尺寸标注") (princ))
(defun c:D3() (setvar "clayer" "0-DM-地坪分割线") (princ))

;;通过命令设换到相应图层
(defun c:F1() (setvar "clayer" "A-ELEV-LIN1-立面外轮廓线") (princ))
(defun c:F2() (setvar "clayer" "A-ELEV-LIN2-立面中轮廓线") (princ))
(defun c:F3() (setvar "clayer" "A-ELEV-LIN3-立面细轮廓线") (princ))
(defun c:F4() (setvar "clayer" "A-FURN-绘图层") (princ))
(defun c:F5() (setvar "clayer" "0-PM-固定家具") (princ))
(defun c:FFC() (setvar "clayer" "DOTE") (princ))
(defun c:FFD() (setvar "clayer" "DOOR") (princ))
(defun c:FFW() (setvar "clayer" "WINDOW") (princ))
(defun c:FFJ() (setvar "clayer" "0-总图-建筑红线") (princ))
(defun c:FFX() (setvar "clayer" "0-总图-用地红线") (princ))
(defun c:FW() (setvar "clayer" "WALL") (princ))
(defun c:F0() (setvar "clayer" "0") (princ))
;;;自动创建常用图层
(defun c:FFF ()
(setvar "cmdecho" 0)
(command "layer" "m" "DOTE""c" "1" "" "l" "DOTE" """")
(command "layer" "m" "WALL" "c" "42" "" "")
(command "layer" "m" "A-ELEV-LIN1-立面外轮廓线" "c" "42" "" "")
(command "layer" "m" "A-ELEV-LIN2-立面中轮廓线" "c" "2" "" "")
(command "layer" "m" "A-ELEV-LIN3-立面细轮廓线" "c" "153" "" "")
(command "layer" "m" "A-ELEV_OTHER-立面配景" "c" "153" "" "")
(command "layer" "m" "0-PM-固定家具" "c" "251" "" "")
(command "layer" "m" "0-PM-建筑面积计算" "c" "6" "" "")
(command "layer" "m" "DOOR" "c" "4" "" "")
(command "layer" "m" "DOOR-NAME" "c" "5" "" "")
(command "layer" "m" "大样剖切线" "c" "4" "" "")
(command "layer" "m" "WALL" "c" "42" "" "")
(command "layer" "m" "A-FURN-绘图层" "c" "2" "" "")
(command "layer" "m" "PUB_WINDW" "c" "7" "" "")
(command ".layer" "p" "p" "PUB_WINDW" "")
(command "layer" "m" "A-FURN-绘图层" "c" "2" "" "")
(command "-style" "ZG" "TXT1.shx,HZTXT1.shx" "" "0.7" "" "" "" "N")
(command "-style" "黑体" "黑体" "" "0.7" "" "" "")
(command ".layer" "p" "p" "PUB_WINDW" "")
(setvar "cmdecho" 1)
(princ)
)

;;;自动创建常用总图图层
(defun c:FFA ()
(setvar "cmdecho" 0)
(command "layer" "m" "0-总图-建筑红线" "c" "1" "" "l" "PHANTOM" """")
(command "layer" "m" "0-总图-用地红线""c" "6" "" "l" "DOTE" """")
(command "layer" "m" "DOTE""c" "1" "" "l" "DOTE" """")
(command "layer" "m" "WALL" "c" "42" "" "")
(command "layer" "m" "0-总图-道路红线" "c" "2" "" "")
(command "layer" "m" "0-总图-道路边线" "c" "3" "" "")
(command "layer" "m" "0-总图-道路中心线" "c" "1" "" "l" "CENTER" """")
(command "layer" "m" "0-总图-建筑外边线" "c" "42" "" "")
(command "layer" "m" "0-总图-建筑可视线" "c" "2" "" "")
(command "layer" "m" "0-总图-已建建筑外边线" "c" "190" "" "")
(command "layer" "m" "0-总图-围墙线" "c" "221" "" "")
(command "layer" "m" "0-总图-构筑物" "c" "6" "" "")
(command "layer" "m" "0-总图-园林植物" "c" "251" "" "")
(command "layer" "m" "0-总图-表格线" "c" "3" "" "")
(command "layer" "m" "0-总图-园林布置" "c" "2" "" "")
(command "layer" "m" "0-总图-摩托车位" "c" "6" "" "")
(command "layer" "m" "0-总图-非机车位" "c" "6" "" "")
(command "layer" "m" "0-总图-绿地面积" "c" "6" "" "")
(command "layer" "m" "0-总图-绿化树" "c" "251" "" "")   
(command "layer" "m" "0-总图-小汽车停车位" "c" "6" "" "")
(command "layer" "m" "PUB_WINDW" "c" "7" "" "")
(command ".layer" "p" "p" "PUB_WINDW" "")
(command "layer" "m" "A-FURN-绘图层" "c" "2" "" "")
(command "-style" "ZG" "TXT1.shx,HZTXT1.shx" "" "0.7" "" "" """N")
(command "-style" "黑体" "黑体" "" "0.7" "" "" "")
(command ".layer" "p" "p" "PUB_WINDW" "")
(setvar "cmdecho" 1)
(princ)
)

;;;自动创建装修常用图层
(defun c:FFG ()
(setvar "cmdecho" 0)
(command "layer" "m" "0-TF-天花布置" "c" "2" "" "")
(command "layer" "m" "0-FURN-平面图" "c" "2" "" "")
(command "layer" "m" "0-TF-天花灯具布置" "c" "6" "" "")
(command "layer" "m" "0-TF-天花尺寸标注" "c" "3" "" "")
(command "layer" "m" "0-DM-地面填充" "c" "251" "" "")
(command "layer" "m" "0-DM-地坪分割线" "c" "251" "" "")
(command "layer" "m" "0-DM-门槛线" "c" "251" "" "")
(command "layer" "m" "0-DM-地面尺寸标注" "c" "3" "" "")
(command "layer" "m" "0-FURN-平面布置图" "c" "2" "" "")
(command "layer" "m" "0-FURN-平面尺寸" "c" "2" "" "")
(command "layer" "m" "0-PM-固定家具" "c" "251" "" "")
(command "layer" "m" "DOOR" "c" "4" "" "")
(command "layer" "m" "DOTE""c" "1" "" "l" "DOTE" """")
(command "layer" "m" "DOOR-NAME" "c" "4" "" "")
(command "layer" "m" "WALL" "c" "42" "" "")
(command "layer" "m" "大样剖切线" "c" "4" "" "")
(command "layer" "m" "PUB_WINDW" "c" "7" "" "")
(command ".layer" "p" "p" "PUB_WINDW" "")
(command "layer" "m" "A-FURN-绘图层" "c" "2" "" "")
(command "-style" "ZG" "TXT1.shx,HZTXT1.shx" "" "0.7" "" "" """N")
(command "-style" "黑体" "黑体" "" "0.7" "" "" "")
(command ".layer" "p" "p" "PUB_WINDW" "")
(setvar "cmdecho" 1)
(princ)
)

;;通过命令设换到相应天花图层
(defun c:T1() (setvar "clayer" "0-TF-天花布置") (princ))
(defun c:T2() (setvar "clayer" "0-TF-天花尺寸标注") (princ))
(defun c:T3() (setvar "clayer" "0-TF-天花灯具布置") (princ))


;;通过命令设换到相应地面图层
(defun c:D1() (setvar "clayer" "0-DM-地面填充") (princ))
(defun c:D2() (setvar "clayer" "0-DM-地面尺寸标注") (princ))
(defun c:D3() (setvar "clayer" "0-DM-地坪分割线") (princ))

;;通过命令设换到相应图层
(defun c:F1() (setvar "clayer" "A-ELEV-LIN1-立面外轮廓线") (princ))
(defun c:F2() (setvar "clayer" "A-ELEV-LIN2-立面中轮廓线") (princ))
(defun c:F3() (setvar "clayer" "A-ELEV-LIN3-立面细轮廓线") (princ))
(defun c:F4() (setvar "clayer" "A-FURN-绘图层") (princ))
(defun c:F5() (setvar "clayer" "0-PM-固定家具") (princ))
(defun c:FFC() (setvar "clayer" "DOTE") (princ))
(defun c:FFD() (setvar "clayer" "DOOR") (princ))
(defun c:FFW() (setvar "clayer" "WINDOW") (princ))
(defun c:FFJ() (setvar "clayer" "0-总图-建筑红线") (princ))
(defun c:FFX() (setvar "clayer" "0-总图-用地红线") (princ))
(defun c:FW() (setvar "clayer" "WALL") (princ))
(defun c:F0() (setvar "clayer" "0") (princ))

sachindkini 发表于 2022-10-3 23:08:17

本帖最后由 sachindkini 于 2022-10-3 23:09 编辑


(defun c:MakeLayers nil (vl-load-com)
;; © Lee Mac 2010

;;----------------------------------------------------------------------------------------------;;
;; Specifications:                                                                              ;;
;;----------------------------------------------------------------------------------------------;;
;; Description         Data Type       Remarks                                                ;;
;;----------------------------------------------------------------------------------------------;;
;; Layer Name          STRING          Only standard chars allowed.                           ;;
;; Layer Colour      INTEGER         may be nil, -ve for Layer Off, Colour < 256            ;;
;; Layer Linetype      STRING          may be nil, If not loaded, CONTINUOUS.                   ;;
;; Layer Lineweight    REAL            may be nil, negative=Default, otherwise 0 <= x <= 2.11   ;;
;; Plot?               BOOLEAN         T = Plot Layer, nil otherwise                            ;;
;; Bit Flag            INTEGER         0=None, 1=Frozen, 2=Frozen in VP, 4=Locked               ;;
;; Description         STRING          may be nil for no description                            ;;
;;----------------------------------------------------------------------------------------------;;
;; Function will print list detailing any unsuccesful layers                                    ;;
;;----------------------------------------------------------------------------------------------;;

(
    (lambda ( lst )
      (mapcar 'print
      (vl-remove-if 'cdr
          (mapcar
            (function
            (lambda ( x )
                (and (caddr x) (LM:LoadLinetype (caddr x))) (cons (car x) (apply 'MakeLayer x))
            )
            )
            lst
          )
      )
      )
    )
   '(
    ;Name               Colour   Linetype    Lineweight Plot? BitflagDescription
    ( "EL_COMPONENTS"            7"CONTINUOUS"   -3       T      0      nil)
    ( "EL_CONSTR_COMP"         1"CONTINUOUS"   -3       T      0      nil)
    ( "EL_FITTINGS"            4"CONTINUOUS"   -3       T      0      nil)
    ( "EL_LABEL"               1"CONTINUOUS"   -3       T      0      nil)
    ( "EL_LABEL_TXT"         252"CONTINUOUS"   -3       T      0      nil)
    ( "EL_TERMINALS"             1"CONTINUOUS"   -3       T      0      nil)
    ( "EL_TERMINALS_PE"         24"CONTINUOUS"   -3       T      0      nil)
    ( "EL_TERMINALS_TXT"       252"CONTINUOUS"   -3       T      0      nil)
    ( "EL_TXT"               252"CONTINUOUS"   -3       T      0      nil)
    ( "EL_WIRES"               252"CONTINUOUS"   -3       T      0      nil)
    ( "GE_ANNOTATION"            7"CONTINUOUS"   -3       T      0      nil)
    ( "GE_LABEL"                10"CONTINUOUS"   -3       T      0      nil)
    ( "GE_LABEL_TEXT"          253"CONTINUOUS"   -3       T      0      nil)
    ( "GE_TXT_LANGUAGE_DU"   252"CONTINUOUS"   -3       T      0      nil)
    ( "GE_TXT_LANGUAGE_EN"   252"CONTINUOUS"   -3       T      0      nil)
    ( "GE_TXT_LANGUAGE_FR"   252"CONTINUOUS"   -3       T      0      nil)
    ( "GE_TXT_LANGUAGE_GE"   252"CONTINUOUS"   -3       T      0      nil)
    ( "LA_HEADER_FRAME"          7"CONTINUOUS"   -3       T      0      nil)
    ( "LA_HEADER_TXT"            7"CONTINUOUS"   -3       T      0      nil)
    ( "LA_MATLIST"             254"CONTINUOUS"   -3       T      0      nil)
    ( "LA_MATLIST_FRAME"       254"CONTINUOUS"   -3       T      0      nil)
    ( "LA_MATLIST_POS"         254"CONTINUOUS"   -3       T      0      nil)
    ( "LA_MATLIST_TXT"         252"CONTINUOUS"   -3       T      0      nil)
    ( "LA_TITLE_FRAME"         7"CONTINUOUS"   -3       T      0      nil)
    ( "LA_TITLE_LOGO"         10"CONTINUOUS"   -3       T      0      nil)
    ( "LA_TITLE_LOGO_TXT"      7"CONTINUOUS"   -3       T      0      nil)
    ( "LA_TITLE_TXT"             7"CONTINUOUS"   -3       T      0      nil)
    ( "LA_VIEWPORTS"         230"CONTINUOUS"   -3      nil   0      nil)
    ( "PN_ACCESSORIES"          30"CONTINUOUS"   -3       T      0      nil)
    ( "PN_ACTUATORS"         160"CONTINUOUS"   -3       T      0      nil)
    ( "PN_AIR_LINE_EQUIPMENT"   40"CONTINUOUS"   -3       T      0      nil)
    ( "PN_BRACKET_MOUNTING"      1"ACAD_ISO12W100" -3       T      0      nil)
    ( "PN_CABINET"               8"CONTINUOUS"   -3       T      0      nil)
    ( "PN_CABINET_DIM"         8"CONTINUOUS"   -3       T      0      nil)
    ( "PN_COMPONENTS"            7"CONTINUOUS"   -3       T      0      nil)
    ( "PN_CONDUCTS"            3"CONTINUOUS"   -3       T      0      nil)
    ( "PN_CONSTR_COMP"         2"CONTINUOUS"   -3       T      0      nil)
    ( "PN_DRAIN"               3"HIDDEN"         -3       T      0      nil)
    ( "PN_EXHAUST"             104"CONTINUOUS"   -3       T      0      nil)
    ( "PN_FITTINGS"             30"CONTINUOUS"   -3       T      0      nil)
    ( "PN_IDENTIFICATION"      4"CONTINUOUS"   -3       T      0      nil)
    ( "PN_PILOT_SUPPLY"          3"HIDDEN"         -3       T      0      nil)
    ( "PN_PORT_NUMBERS"          8"CONTINUOUS"   -3       T      0      nil)
    ( "PN_PRESSURE_SWITCHES"   200"CONTINUOUS"   -3       T      0      nil)
    ( "PN_PROPORTIONAL_VALVES" 226"CONTINUOUS"   -3       T      0      nil)
    ( "PN_SECTIONS"            3"CONTINUOUS"   -3       T      0      nil)
    ( "PN_SUB-BASES"             8"ACAD_ISO12W100" -3       T      0      nil)
    ( "PN_SUB-BASE_CONDUCTS"   2"CONTINUOUS"   -3       T      0      nil)
    ( "PN_SUPPLY"                3"CONTINUOUS"   -3       T      0      nil)
    ( "PN_TXT"                   3"CONTINUOUS"   -3       T      0      nil)
    ( "PN_VACUUM"               60"CONTINUOUS"   -3       T      0      nil)
    ( "PN_VALVES"            240"CONTINUOUS"   -3       T      0      nil)
    ( "PN_VALVES_OVERRIDE"       1"CONTINUOUS"   -3       T      0      nil)
    )
)
(princ)
)

(defun MakeLayer ( name colour linetype lineweight willplot bitflag description )
;; © Lee Mac 2010
(or (tblsearch "LAYER" name)
    (entmake
      (append
      (list
          (cons 0 "LAYER")
          (cons 100 "AcDbSymbolTableRecord")
          (cons 100 "AcDbLayerTableRecord")
          (cons 2name)
          (cons 70 bitflag)
          (cons 290 (if willplot 1 0))
          (cons 6
            (if (and linetype (tblsearch "LTYPE" linetype))
            linetype "CONTINUOUS"
            )
          )
          (cons 62 (if (and colour (< 0 (abs colour) 256)) colour 7))
          (cons 370
            (if (minusp lineweight) -3
            (fix
                (* 100
                  (if (and lineweight (<= 0.0 lineweight 2.11)) lineweight 0.0)
                )
            )
            )
          )
      )
      (if description
          (list
            (list -3
            (list "AcAecLayerStandard" (cons 1000 "") (cons 1000 description))
            )
          )
      )
      )
    )
)
)

;;--------------------=={ Load Linetype }==-------------------;;
;;                                                            ;;
;;Attempts to load a specified linetype from any linetype   ;;
;;definition files (.lin) found in the ACAD Support Path    ;;
;;------------------------------------------------------------;;
;;Author: Lee Mac, Copyright © 2011 - www.lee-mac.com       ;;
;;------------------------------------------------------------;;
;;Arguments:                                                ;;
;;lt - name of linetype to load                           ;;
;;------------------------------------------------------------;;
;;Returns:T if linetype loaded successfully, else nil   ;;
;;------------------------------------------------------------;;

(defun LM:LoadLinetype ( lt ) (vl-load-com)
;; © Lee Mac 2010

(cond
    ( (tblsearch "LTYPE" lt) )
    ( (progn
      (or acdoc (setq acdoc (vla-get-ActiveDocument (setq acapp (vlax-get-acad-object)))))
      (or aclts (setq aclts (vla-get-Linetypes acdoc)))

      (vl-some
          (function
            (lambda ( file )
            (vl-catch-all-apply 'vla-load (list aclts lt file))
            (and (tblsearch "LTYPE" lt))
            )
          )
          (setq *LineTypeDefs*
            (cond
            ( *LineTypeDefs* )
            (
                (apply 'append
                  (mapcar '(lambda ( directory ) (vl-directory-files directory "*.lin" 1))
                  (LM:str->lst
                      (vla-get-SupportPath (vla-get-Files (vla-get-Preferences acapp))) ";"
                  )
                  )
                )
            )
            )
          )
      )
      )
    )
)
)

;;-------------------=={ String to List }==-------------------;;
;;                                                            ;;
;;Separates a string into a list of strings using a         ;;
;;specified delimiter string                              ;;
;;------------------------------------------------------------;;
;;Author: Lee Mac, Copyright © 2011 - www.lee-mac.com       ;;
;;------------------------------------------------------------;;
;;Arguments:                                                ;;
;;str - string to process                                 ;;
;;del - delimiter by which to separate the string         ;;
;;------------------------------------------------------------;;
;;Returns:A list of strings                               ;;
;;------------------------------------------------------------;;

(defun LM:str->lst ( str del / pos )
;; © Lee Mac 2010
(if (setq pos (vl-string-search del str))
    (vl-remove "" (cons (substr str 1 pos) (LM:str->lst (substr str (+ pos 1 (strlen del))) del)))
    (list str)
)
)

tigcat 发表于 2022-7-18 17:56:06

谢谢分享,支持楼主一下。

丶俗人 发表于 2022-7-19 01:49:01

楼主,你可以看一下这个哟,也是很强大呢~
可以强制更新图层信息.
http://bbs.mjtd.com/thread-111246-1-1.html

sncokina 发表于 2022-7-19 08:44:03

谢谢分享,支持

tfanghui 发表于 2022-7-20 10:10:25

丶俗人 发表于 2022-7-19 01:49
楼主,你可以看一下这个哟,也是很强大呢~
可以强制更新图层信息.
http://bbs.mjtd.com/thread-111246-1-1. ...

他这很强大,我试了一下,但是多建几个图层就会出现错误,不知道是什么原因。

丶俗人 发表于 2022-7-25 00:42:04

tfanghui 发表于 2022-7-20 10:10
他这很强大,我试了一下,但是多建几个图层就会出现错误,不知道是什么原因。

应该不会呀.我都是一次性创建五六十个图层.
应该是你图层的代码哪里出错了.

paulpipi 发表于 2022-7-25 08:44:20

感谢分享,挺好的程序

czb203 发表于 2022-7-25 15:45:14

感谢分享,挺好的程序

宁静港湾 发表于 2022-7-25 16:55:50

下来试试,谢谢大佬分手

hzyhzjjzh 发表于 2022-7-26 13:47:25


谢谢分享,{:1_1:}
页: [1] 2 3
查看完整版本: 自动建立图层并指定图层名称、颜色、线型 、线宽