这是很旧的代码,
也许可以试试这个:
- (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 2 name)
- (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
- (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))
- )
- )
- )
- )
- )
- )
- )
- (defun c:MakeLayers ( )
- ;; © Lee Mac 2010
- (
- (lambda ( lst )
- (mapcar 'cons (car lst) (apply 'mapcar (cons 'MakeLayer lst)))
- )
- '(
- ( "CEN" "DIMS" "HAT" "HID" "LOGO" "OBJ" "PAPER" "PHAN" "TITLE" "TXT" ) ; Layer Name [ STR ]
- ( 6 -1 3 4 176 -2 5 6 176 7 ) ; Layer Colour (-ve for layer off) [ INT ]
- ("CENTER" nil nil "HIDDEN" nil nil "PHANTOM" "PHANTOM" nil nil ) ; Layer LineType [ STR ]
- ( 0.18 0.18 0.18 0.15 0.09 0.40 nil 0.18 nil nil ) ; Layer LineWeight [ REAL ]
- ( T T T T T T nil T T T ) ; Plot? (T or nil) [ BOOLE ]
- ( 0 1 5 0 0 3 6 0 1 0 ) ; Bit Flag (0 = None, 1=Frozen, 2=Frozen in Vp, 4=Locked) [ INT ]
- ( nil "Dimensions" nil "Hidden""For Logo" nil nil nil "For Title" nil ) ; Description (nil for none) [ STR ]
- )
- )
- )
|