Um programa para trabalhar com layers. Com ele você exporta para um arquivo de texto os layers de um desenho, para importar em outro. Útil quando você precisa "padronizar" alguns desenhos
para utilizar, digite SLAY na linha de comando para salvar, e LLAY para abrir um arquivo de layers salvo
mais...
(setq layers:ext_file "lay2")
(defun c:slay (/ file tmp)
(tbn:error-init NIL)
(setq file (getfiled "Salvar arquivo de layers" "c:/" layers:ext_file 1)
file (if file (open file "w") (exit)))
(write-line "'(" file)
(vlax-for tmp (vla-get-LAYERS THISDRAWING)
(write-line
(TOSTRING (LIST (vla-get-name tmp)
(vla-GET-color tmp)
(vla-GET-linetype TMP)))
file))
(write-line ")" file)
(close file)
(tbn:error-restore))
(defun c:llay (/ file lay nome tmp ltype ltypes)
(tbn:error-init NIL)
(setq file (getfiled "Selecione o Arquivo de layers" "c:/" layers:ext_file 4)
file (if file (load file nil))
layers (vla-get-layers thisDRAWING)
ltypes (vla-get-linetypes thisDRAWING))
(foreach tmp file ;(setq tmp (cadddr file))
(MAPCAR 'set '(nome cor ltype) tmp)
(setq ltype (if (tblsearch "ltype" ltype)
ltype
(if (not (vl-catch-all-error-p (vl-catch-all-apply 'vla-load (list ltypes ltype "acad.lin"))))
ltype)))
(if (vl-catch-all-error-p (setq lay (vl-catch-all-apply 'vla-item (list layers nome))))
(setq lay (vla-add layers nome)))
(vla-put-color lay (if (< cor 256) cor 1))
(if ltype (vla-put-linetype lay ltype)))
(tbn:error-restore))
Link(s) da(s) subrotina(s) usada(s):
tbn:error-init, THISDRAWING, TOSTRING, tbn:error-restore
(defun c:slay (/ file tmp)
(tbn:error-init NIL)
(setq file (getfiled "Salvar arquivo de layers" "c:/" layers:ext_file 1)
file (if file (open file "w") (exit)))
(write-line "'(" file)
(vlax-for tmp (vla-get-LAYERS THISDRAWING)
(write-line
(TOSTRING (LIST (vla-get-name tmp)
(vla-GET-color tmp)
(vla-GET-linetype TMP)))
file))
(write-line ")" file)
(close file)
(tbn:error-restore))
(defun c:llay (/ file lay nome tmp ltype ltypes)
(tbn:error-init NIL)
(setq file (getfiled "Selecione o Arquivo de layers" "c:/" layers:ext_file 4)
file (if file (load file nil))
layers (vla-get-layers thisDRAWING)
ltypes (vla-get-linetypes thisDRAWING))
(foreach tmp file ;(setq tmp (cadddr file))
(MAPCAR 'set '(nome cor ltype) tmp)
(setq ltype (if (tblsearch "ltype" ltype)
ltype
(if (not (vl-catch-all-error-p (vl-catch-all-apply 'vla-load (list ltypes ltype "acad.lin"))))
ltype)))
(if (vl-catch-all-error-p (setq lay (vl-catch-all-apply 'vla-item (list layers nome))))
(setq lay (vla-add layers nome)))
(vla-put-color lay (if (< cor 256) cor 1))
(if ltype (vla-put-linetype lay ltype)))
(tbn:error-restore))
Link(s) da(s) subrotina(s) usada(s):
tbn:error-init, THISDRAWING, TOSTRING, tbn:error-restore
para utilizar, digite SLAY na linha de comando para salvar, e LLAY para abrir um arquivo de layers salvo
como separa os pontos do levantamento topografico por camada, que nem no topograph?
ResponderExcluirdescriptionkeysets
ResponderExcluir