How to turn off/not display text in DCL

#1
I'm trying to not display the highlighted text (dimensions) highlighted in the blue box.
Image
.
.
I have tried this code:

Code: Select all

(defun SET_DIM ()
	(setvar 'dimzin 0)
;
;	 (if (and (= NEWTILE "s7") (/= SIZE NIL))
;    (PIPE_SETDIM)
;  ) ;_ end of if
;
	(cond ((= NEWTILE "s7")(PIPE_SETDIM))
		(T 
	(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
	)
	) ;end of cond		
;
  (if (= SCA "1")(SCA_TO_IMP)) ;_ end of if	
;
  (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)
;
) ;End SET_DIM
;------------------------------------------------------------------------;
;------------------------------------------------------------------------;
(defun PIPE_SETDIM ()
  (setq
    N1 (nth 3 SIZE_DIMS)
    N6 (nth 8 SIZE_DIMS)
    N7 (nth 9 SIZE_DIMS)
    N9 (nth 11 SIZE_DIMS)
  ) ;end setq
;  
;  (if (= SCA "1")(SCA_TO_IMP)) ;_ end of if	
; 
  (set_tile "n1" (rtos N1 2 2))
  (set_tile "n6" (rtos N6 2 2))
  (set_tile "n7" (rtos N7 2 2))
  (set_tile "n9" (rtos N9 2 2))  
) ;end of PIPE_SETDIM
Neither the IF statement or the Condition statements work.
Anyone able to offer suggestions/pointers?
full code attached.
S
Attachments
SLN_PIPING-REV 2-0-5c-ICAD9-0.zip
(6.63 KiB) Downloaded 255 times

Re: How to turn off/not display text in DCL

#5
Thanks again Quan,

I can get your code to work in SET_DIM, but this is the main/primary setup.
There are a few cases where I do not want to show all of the zeros for dimensions not used.
I tried to use an IF statement to change the display to remove the zeros in a case (PIPE_SETDIM) where the are not required.
Adding your suggestion to PIPE_SETDIM has no impact. :(

Code: Select all

(defun SET_DIM ()
	(setvar 'dimzin 0)
;
;	 (if (and (= NEWTILE "s7") (/= SIZE NIL))
;    (PIPE_SETDIM)
;  ) ;_ end of if
;
	(cond ((= NEWTILE "s7")(PIPE_SETDIM))
		(T 
	(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
	)
	) ;end of cond		
;
  (if (= SCA "1")(SCA_TO_IMP)) ;_ end of if	
;
  (set_tile "n1" (rtos N1 2 2))
  (mode_tile "n2" 1)
  (mode_tile "n3" 1)
  (mode_tile "n4" 1)
  (mode_tile "n5" 1)
  (set_tile "n6" (rtos N6 2 2))
  (set_tile "n7" (rtos N7 2 2))
  (mode_tile "n8" 1)
  (set_tile "n9" (rtos N9 2 2))
  (mode_tile "n10" 1) 
;

  (setvar 'dimzin 8)
;
) ;End SET_DIM
Steve

Re: How to turn off/not display text in DCL

#7
Ok, so I was attempting to have the IF/COND statements in the SET_DIM function.

I have moved these into there own function, which is explicitly where the appropriate dimension display is defined.
[note: I have put this into the original SET_DIM function as this is referenced elsewhere in the code, also it is the 'start' of the dims code (in my eyes :) )]

Code: Select all

(defun SET_DIM ()
	(cond
	((= sel "pipe_")(PIPE_SETDIM)
	)
	((= ftg "lre90_")(EL90_SETDIM)
	)
	((= ftg "lre45_")(EL45_SETDIM)
	)
	(t (MAIN_DIM))
	) ;_ end of cond	
) ;END SET_DIM
.
MAIN_DIM [was SET_DIM] now looks like this:

Code: Select all

(defun MAIN_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
;
  (if (= SCA "1")(SCA_TO_IMP)) ;_ end of if	
;
  (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)
) ;End MAIN_DIM
With the individual Dimension sets like this:

Code: Select all

(defun PIPE_SETDIM ()
  (setq
    N1 (nth 3 SIZE_DIMS)
    N6 (nth 8 SIZE_DIMS)
    N7 (nth 9 SIZE_DIMS)
    N9 (nth 11 SIZE_DIMS)
  ) ;end setq
;  
  (if (= SCA "1")(SCA_TO_IMP)) ;_ end of if	
; 
  (set_tile "n1" (rtos N1 2 2))
  (mode_tile "n2" 1)
  (mode_tile "n3" 1)
  (mode_tile "n4" 1)
  (mode_tile "n5" 1)
  (set_tile "n6" (rtos N6 2 2))
  (set_tile "n7" (rtos N7 2 2))
  (mode_tile "n8" 1)
  (set_tile "n9" (rtos N9 2 2))
  (mode_tile "n10" 1)  
) ;end of PIPE_SETDIM
;------------------------------------------------------------------------;
(defun EL90_SETDIM ()
  (setq
    N1 (nth 3 SIZE_DIMS)
    N2 (nth 4 SIZE_DIMS)
    N6 (nth 8 SIZE_DIMS)
    N7 (nth 9 SIZE_DIMS)
    N9 (nth 11 SIZE_DIMS)
  ) ;end setq
;  
  (if (= SCA "1")(SCA_TO_IMP)) ;_ end of if	
; 
  (set_tile "n1" (rtos N1 2 2))
  (set_tile "n2" (rtos N2 2 2))
  (mode_tile "n3" 1)
  (mode_tile "n4" 1)
  (mode_tile "n5" 1)
  (set_tile "n6" (rtos N6 2 2))
  (set_tile "n7" (rtos N7 2 2))
  (mode_tile "n8" 1)
  (set_tile "n9" (rtos N9 2 2))
  (mode_tile "n10" 1)  
) ;end of EL90_SETDIM
;------------------------------------------------------------------------;
(defun EL45_SETDIM ()
  (setq
    N1 (nth 3 SIZE_DIMS)
    N2 (nth 4 SIZE_DIMS)
    N3 (nth 5 SIZE_DIMS)	
    N6 (nth 8 SIZE_DIMS)
    N7 (nth 9 SIZE_DIMS)
    N9 (nth 11 SIZE_DIMS)
  ) ;end setq
;  
  (if (= SCA "1")(SCA_TO_IMP)) ;_ end of if	
; 
  (set_tile "n1" (rtos N1 2 2))
  (set_tile "n2" (rtos N2 2 2))
  (set_tile "n3" (rtos N3 2 2))  
  (mode_tile "n4" 1)
  (mode_tile "n5" 1)
  (set_tile "n6" (rtos N6 2 2))
  (set_tile "n7" (rtos N7 2 2))
  (mode_tile "n8" 1)
  (set_tile "n9" (rtos N9 2 2))
  (mode_tile "n10" 1)  
) ;end of EL45_SETDIM
Thanks again Quan for the help :)

Steve