Steven posted 'just' before I was able to post and have made some comments for the first half of your code but its ba-sick-ly what Steven said : some variables are not set , not by the code you posted anyway. Also you should localize your variables and maybe think about some better names for your variables unless you want to become the human Kelvinator (some know what I mean and some probably not haha)
(defun Section_print ( / )
(setvar "osmode" 0)
;;; unknown : sc1
(setq sc2 (/ sc1 100))
(setq oo1 (list(- (car set3) (* sc2 1.500)) (- (cadr set3) (* sc2 0.700)))
oo2 (list(- (car set3) (* sc2 1.300)) (- (cadr set3) (* sc2 1.380)))
oo3 (list(- (car set3) (* sc2 11.90)) (- (cadr set3) (* sc2 0.215)))
oo4 (list(- (car set3) (* sc2 11.90)) (- (cadr set3) (* sc2 0.645)))
oo5 (list(- (car set3) (* sc2 11.90)) (- (cadr set3) (* sc2 1.075)))
oo6 (list(- (car set3) (* sc2 11.90)) (- (cadr set3) (* sc2 1.505)))
sca (rtos (* 1 sc1) 2 2)
scp (/ 1000 sc1)
)
(Command "style" "mntn" "microsoft Yi Baiti" "2" "1" "0" "n" "n")
;;; unknown tbn
(command "insert" tbn set3 sc2 sc2 0)
(command "mtext" oo1 "j" "mc" "h" (* sc2 0.120) "r" 0 "w" (* sc2 4) cro "")
(command "mtext" oo2 "j" "ml" "h" (* sc2 0.120) "r" 0 "w" (* sc2 4) sca "")
(command "mtext" oo3 "j" "ml" "h" (* sc2 0.120) "r" 0 "w" (* sc2 6) des "")
(command "mtext" oo4 "j" "ml" "h" (* sc2 0.120) "r" 0 "w" (* sc2 4) dat "")
(command "mtext" oo5 "j" "ml" "h" (* sc2 0.120) "r" 0 "w" (* sc2 4) dra "")
(command "mtext" oo6 "j" "ml" "h" (* sc2 0.120) "r" 0 "w" (* sc2 4) drb "")
)
(defun C:Single_print
;;; localize your variables
( / ch1 chpdf pdfsaveA pdfsaveB pdfsaveC set1 set2 bloh bupc blowc s1 na set4 set5 set6 set3 xx3 xx4
;;; other variabbles that could be localized here / are missing in action
pdfsave sett incrs bh sc1 sc2 pdf_pri ptde scp
)
;;; *** chpdf not needed if you use getint instead of getreal?
;;; *** (setq ch1 (getint "\nWhat ch.? : ") pdfsaveA (itoa ch1))
(setq ch1 (getreal "What ch ..")) (setq chpdf (fix ch1)) (setq pdfsaveA (itoa chpdf))
(setq pdfsaveB (strcat "CH " pdfsaveA))
;;; unknown : pdfsave
(setq pdfsaveC (strcat pdfsave pdfsaveB))
;;; unknown : sett , incrs , bh
(setq set1 (/ sett incrs) set2 (* set1 ch1) bloh (* bh -8) bupc (- 0.25 bh) blowc (- (+ 0.25 bh)))
(setvar "osmode" 0)
(command "zoom" "c" (list set2 0) 300)
;;; *** if nothing is selected ssget will be nil so test for this with IF or some like to use it in AND statement
(if (setq s1 (ssget "w" (list (- set2 200) bupc) (list (+ set2 200) blowc)))
(progn
(setq na (entget (ssname s1 0)))
(setq set4 (cdr (assoc 10 na)))
(setq set5 (cdr (assoc 11 na)))
(setq set6 (/ (+ (car set5) (car set4)) 2))
(setq set3 (list set6 bloh))
)
)
;;; section_print uses sc1 , where is this set?
(Section_print)
;;; sc2 is set in section_print so make sure its not localized in section_print
(setq xx3 (list(+ (car set3) (* sc2 13.76)) (- (cadr set3) (* sc2 2.51)))
xx4 (list(- (car set3) (* sc2 13.76)) (+ (cadr set3) (* sc2 16.310)))
xx5 (list(- (car set3) (* sc2 13.76)) (+ (cadr set3) (* sc2 0.1)))
)
; (command "zoom" "p")
;;; *** unknowns : pdf_pri , ptde , scp
(if (= pdf_pri 1)
(command "plot" "y" "" ptde "ISO expand A4 (297.00 x 210.00 MM)" "m" "l" "" "w" xx3 xx4 scp "c" "y" "" "y" "" pdfsaveC "n" "y")
(command "plot" "y" "" ptde "A4 (210 x 297 MM)" "M" "L" "" "w" xx3 xx4 scp "0,0" "" "" "" "" "" "" "")
)
(command "erase" "C" xx3 xx5 "")
;;; (command "plot" "w" xx3 xx4 "5" "n" "n" "m" "0,0" "90" "n" "n" scp "0")
)