(defun c:NV
(/ *error* _RestoreView p1 p2 doc ct vs vc tmp mp sc ll sl res vpdoc vpp vp ans
) )
)
)
"\nWhat is Viewport Scale 1: <"
">: "
)
)
)
( sc )
)
)
%
)
res
)
)
)
)
)
)
)
)
(if (setq sl
(cd:DCL_StdListDialog
(mapcar '
car ll
) 0 "NewViewport" "Select layout:" 40 15 2 nil T T
)) (<
)
(setq tmp p1 p1 p2 p2 tmp
) )
0.0
)
)
vpdoc
)
)
1.0
)
( (getkword "\nBack to model space [Yes/No] <No>: ") ) ( "No" )
)
)
(if (= ans
"Yes") (_RestoreView
)) )
(princ "\n** Invalid Point ** ") )
)
)
(princ "\n** Layout not selected ** ") )
)
(princ "\n** Invalid Point ** ") )
(princ "\nStart Program in Model Space ") )
)
; =========================================================================================== ;
; Okno dialogowe z lista (list_box) / Dialog control with list (list_box) ;
; Data [list] - lista do wyswietlenia / list to display ;
; Pos [INT] - pozycja poczatkowa na liscie / select list position ;
; Title [STR/nil] - tytul okna / window title ;
; ListTitle [STR/nil] - tytul list_box / list_box title ;
; Width [INT] - szerokosc / width ;
; Height [INT] - wysokosc / height ;
; Btns [0/1/2] - [cancel/ok/ok_cancel] przyciski / buttons ;
; MSelect [T/nil] - dopuszczenie multiple_select / allow multiple select ;
; DPos [T/nil] - zapamietanie pozycji okna / save window position ;
; DblClick [T/nil] - podwojny klik (wykluczone Cancel) / double click (not for Cancel) ;
; ------------------------------------------------------------------------------------------- ;
; Zwraca / Return: ;
; nil = nic nie wybrano (anulowano) / nothing was selected (canceled) ;
; INT = wybrano jedna pozycje / one position selected | MSelect = nil ;
; LIST = wybrano kilka pozycji / few positions selected | MSelect = T ;
; ------------------------------------------------------------------------------------------- ;
; (cd:DCL_StdListDialog '("A" "B" "C") 0 "Title" "ListTitle:" 40 15 2 nil T nil) ;
; =========================================================================================== ;
(defun cd:DCL_StdListDialog
(Data Pos Title ListTitle Width Height Btns MSelect DPos DblClk
/ f tmp dc res)
"w"
)
)
"StdListDialog:dialog{"
)
":list_box{key=\"list\";"
(strcat "label=\"" ListTitle
"\";")"" )
"fixed_width=true;fixed_height=true;"
)
)
(if MSelect
"true;" "false;") )
"multiple_select=false;"
)
"}"
( (zerop Btns
) "cancel_button;") ( (= 1 Btns) "ok_only;")
(T "ok_cancel;")
)
"}"
)
)
( *cd-TempDlgPosition* )
)
)
)
)
)
( T
)
"(setq res $value)(if DblClk (if(or(not MSelect)"
"(not (zerop Btns)))"
"(if (= $reason 4)(setq "
"*cd-TempDlgPosition* (done_dialog 1)))))"
)
)
(action_tile "accept" "(setq *cd-TempDlgPosition* (done_dialog 1))") (action_tile "cancel" "(setq res nil) (done_dialog 0)") nil
)
)
)
)
)
(princ "\n Type NV to Invoke ")