(defun CW_2DRH ( / ET_sel ET_SS )
;Make sure the "Hidden" linetype exists, else create it
(if (null (tblsearch "LTYPE" "HIDDEN2")) (command ".linetype" "Load" "HIDDEN2" "" ))
;Make sure the "Hidden Lines" layer exists, else create iot
(if (null (tblsearch "LAYER" "Hidden Lines"))
(command
"_.LAYER"
"_Make" "Hidden Lines"
"_Color" "120,120,120" ""
"_Ltype" "HIDDEN2" "Hidden Lines" ""
"_LWeight" "0.15" "Hidden Lines" ""
""
)
)
;;;Ask the designer to pick a single viewport to process
(setq sel (entsel))
;Do things
(command "2DREPH" "" (car sel) "" "A" "Y")
(setq SS (ssget "X" (list (cons 6 "HIDDEN"))))
(command "_.CHANGE" SS "" "_P" "_LT" "BYLAYER" "")
(command "_.CHANGE" SS "" "_P" "_LA" "HIDDEN" "")
(command "_.CHANGE" SS "" "_P" "_C" "BYLAYER" "")
(command "_.GROUP" "c" "*" "" SS "")
(princ) ;exit quietly
);end defun 2DR