Named Views
This little tool is turning into a real people pleaser. I created 2 new buttons on our custom ribbon to Save and Restore named views. They are named Plan and Profile. It saves a lot of headaches navigating areas of the drawing. The lisp could not be simpler.
;------------------------------------------------------------------
; Create Named Views and Restore them
; created Nov 2022 by Donald Broussard
; Fusion Engineering and Technology
; +1 619 736 2800
;
(defun FET:ManageView ( sName / )
(defun *error* (sMsg)
(if (not (wcmatch (strcase sMsg) "*BREAK*,*CANCEL*,*EXIT*")) ; user escape
(FET:Notify (strcat "\nFET-E Unexpected Error: " sMsg) 5)
)
(FET:DWGSettings "RESTORE")
(quit)
)
(if (tblsearch "VIEW" sName)
(vl-cmdf "VIEW" "R" sName)
(vl-cmdf "VIEW" "S" sName)
)
(princ) ;exit quietly
)
;------------------------------------------------------------------
; Create Named Views and Restore them
; created Nov 2022 by Donald Broussard
; Fusion Engineering and Technology
; +1 619 736 2800
;
(defun FET:ManageView ( sName / )
(defun *error* (sMsg)
(if (not (wcmatch (strcase sMsg) "*BREAK*,*CANCEL*,*EXIT*")) ; user escape
(FET:Notify (strcat "\nFET-E Unexpected Error: " sMsg) 5)
)
(FET:DWGSettings "RESTORE")
(quit)
)
(if (tblsearch "VIEW" sName)
(vl-cmdf "VIEW" "R" sName)
(vl-cmdf "VIEW" "S" sName)
)
(princ) ;exit quietly
)
0
Comments
-
For me I would just read the views table and get all the names with an option add a new one.
Get all view names as a list with extra "new" option eg ("Please choose" "Plan" "Profile" "Section" "New")
(if (not AH:Butts)(load "Multi radio buttons.lsp"))
(setq sname (ah:butts 1 "V" lst ))) ; the button picked value as a string
0