(defun c:xreflay (/ ss i vla) ; Put Xrefs to TPZ-XREF Layer
;; Tharwat 31. Oct. 2011 ;;
(if (setq ss (ssget "_x" '((0 . "INSERT"))))
(repeat
(setq i (sslength ss))
(setq vla (vlax-ename->vla-object (ssname ss (setq i (1- i)))))
(if (vlax-property-available-p vla 'Path)
(vla-put-layer vla "TPZ-XREF")
)
)
(princ)
)
(princ)
)

(defun C:ImgLay (/ SETD LAY) ; Begin function

(setvar "CMDECHO" 0) ; Turn off command echo

(setq SETD (ssget "X" '((0 . "IMAGE")))) ; Selection set of dims

(if (null SETD) ; If there are no dims

(princ "\nThere are no associated Images.") ; THEN tell user

(progn ; ELSE begin (progn)

;(setq LAY (getstring "\nTransfer to which layer? ")) ; Get layer name

(command ".CHPROP" SETD "" "LA" "TPZ-XREF" "") ; Change dimensions to layer

) ; End (progn)

) ; End (if)

(setvar "CMDECHO" 1) ; Turn on command echo

(princ) ; Clean exit

) ; End function

; - -( End of Program )- -

(defun C:pdfLay (/ SETD LAY) ; Begin function

(setvar "CMDECHO" 0) ; Turn off command echo

(setq SETD (ssget "X" '((0 . "PDFUNDERLAY")))) ; Selection set of dims

(if (null SETD) ; If there are no dims

(princ "\nThere are no associated PDFs.") ; THEN tell user

(progn ; ELSE begin (progn)

;(setq LAY (getstring "\nTransfer to which layer? ")) ; Get layer name

(command ".CHPROP" SETD "" "LA" "TPZ-XREF" "") ; Change dimensions to layer

) ; End (progn)

) ; End (if)

(setvar "CMDECHO" 1) ; Turn on command echo

(princ) ; Clean exit

) ; End function

; - -( End of Program )- -

(defun C:dwfLay (/ SETD LAY) ; Begin function

(setvar "CMDECHO" 0) ; Turn off command echo

(setq SETD (ssget "X" '((0 . "DWFUNDERLAY")))) ; Selection set of dims

(if (null SETD) ; If there are no dims

(princ "\nThere are no associated DWFs.") ; THEN tell user

(progn ; ELSE begin (progn)

;(setq LAY (getstring "\nTransfer to which layer? ")) ; Get layer name

(command ".CHPROP" SETD "" "LA" "TPZ-XREF" "") ; Change dimensions to layer

) ; End (progn)

) ; End (if)

(setvar "CMDECHO" 1) ; Turn on command echo

(princ) ; Clean exit

) ; End function

; - -( End of Program )- -

(c:imglay)
(c:pdflay)
(c:dwflay)
(c:xreflay)

Advertisements