So I've added a 'Metric/Imperial' Scaling toggle to my DCL & LSP files, RB24.
See image below, highlighted red.
This works in part, in that when the 'toggle' is selected (ticked) the scale is applied to the inserted blocks.
It also is applied to the Pipe creation/extrusion.
.
Code: Select all
(defun RB24_FLAG ()
(setq sca "1") ;store metric / imperial scale
);end RB24_FLAG
;-----------------------------------------------
(defun SET_DIM ()
(setvar 'dimzin 0)
(setq
N1 (nth 3 SIZE_DIMS)
N2 (nth 4 SIZE_DIMS)
N3 (nth 5 SIZE_DIMS)
N4 (nth 6 SIZE_DIMS)
N5 (nth 7 SIZE_DIMS)
N6 (nth 8 SIZE_DIMS)
N7 (nth 9 SIZE_DIMS)
N8 (nth 10 SIZE_DIMS)
N9 (nth 11 SIZE_DIMS)
N10 (nth 12 SIZE_DIMS)
) ;end setq
;
(set_tile "n1" (rtos N1 2 2))
(set_tile "n2" (rtos N2 2 2))
(set_tile "n3" (rtos N3 2 2))
(set_tile "n4" (rtos N4 2 2))
(set_tile "n5" (rtos N5 2 2))
(set_tile "n6" (rtos N6 2 2))
(set_tile "n7" (rtos N7 2 2))
(set_tile "n8" (rtos N8 2 1))
(set_tile "n9" (rtos N9 2 2))
(set_tile "n10" (rtos N10 2 2))
(setvar 'dimzin 8)
;
(if (= SCA "1")(SCA_TO_IMP)) ;_ end of if ;NEW LINE ADDED FOR SCALING
;
) ;End SET_DIM
;------------------------------------------------------------------------;
(defun SCA_TO_IMP ()
(setq scal "0.03937")
(setq
N1 (* N1 0.03937)
N2 (* N2 0.03937)
N3 (* N3 0.03937)
N4 (* N4 0.03937)
N5 (* N5 0.03937)
N6 (* N6 0.03937)
N7 (* N7 0.03937)
N8 (* N8 0.03937)
N9 (* N9 0.03937)
N10 (* N10 0.03937)
);end of setq
) ;End SCA_TO_IMP
Here I'm struggling, can anyone give me a few pointers?
Full code attached.
SteveN