Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi guys i am having a problem with my code. i am trying to change the layer of the viewports in my sheet, it works well but at the end i want to change the layer back to the last layer it was on but it doesnt want to. not sure why
(defun c:C_CVL (/ selViewports OldLayer)
(setq OldLayer(Getvar "Clayer"))
(setq selViewports (ssget "X" '((0 . "VIEWPORT"))))
(if(tblsearch "LAYER" ".VIEWPORT")
(setvar "Clayer" ".VIEWPORT")
(command "-layer" "m" ".VIEWPORT" "c" 150 "" "P" "N" """"))
(command "CHPROP" sel1 "" "LAYER" ".VIEWPORT" "")
(setvar "Clayer" OldLayer )
(princ)
)
Civil 3D Certified Professional
Solved! Go to Solution.