35.
(Setq num 10)
(While (> num cnt)
(setq numberOne (getreal "\nEnter first number : ")
numberTwo (getreal Enter second number :)
)
;;;;;; Malformed List
(if (= numberOne numberTwo)
(Princ "\nThe two number entered are the same : ")
(setq answer (* numberOne numerTwo))
)
;;;;; Malformed List
(princ "The products of the two numbers are" (rtos answer))
)
36.
(while (<= loop_cnt list_cnt)
(setq resistor (nth loop_cnt resistor_list))
(if (/= resistor nil)
(setq equilivent_resistance
(+ equilivent_resistance resistor)
)
)
(setq loop_cnt (1- loop_cnt))
)
37.
(DEFUN c:CalculateBtu()
(SETQ Cnt 1
TotalRFactor 0
)
(REPEAT 10
(SETQ Prompt (STRCAT “\nEnter the R value for material # “
(Itoa Cnt)
)
TotalRFactor ( +
(GETREAL Prompt)
TotalRFactor
)
Cnt (1+ Cnt)
OutAirTemp (GETREAL “\nEnter outside Air Temp : “)
InAirTemp (GETREAL “\nEnter inside Air Temp : “)
WallLength (GETREAL “\nEnter wall length : “)
WallHeight (GETREAL “\nEnter wall height : “)
WallArea ( * WallLength WallHeight)
Ufactor (/ 1.0 TotalRFactor)
DeltaTemp (ABS (- OutAirTemp InAirTemp))
BtuPerHour (* WallArea Ufactor DeltaTemp)
)
)
)
38.
(DEFUN C:ChangeLine ()
(SETQ Entity (ENTSEL “\nSelect line to change”))
(If (/= Entity Nil)
(PROGN
(SETQ Ent (ENTGET (CAR Entity)))
(IF (= (CDR (ASSOC 0 Ent)) “LINE”)
(PROGN
(SETQ PointOne (GETPOINT “\nSelect first
point of Line”)
PointTwo (GETPOINT “\nSelect second
point of line”)
PointOne (CONS 10 PointOne)
PointTwo (CONS 11 PointTwo)
Ent (SUBST PointOne (Assoc 10 ent) ent)
Ent (SUBST PointTwo (Assoc 10 ent) ent)
)
(ENTMOD Ent)
(ENTUPD (CAR Ent))
)
(ALERT “A line must be selected”)
)
)
(ALERT “Nothing Selected”)
)
)
39.
(DEFUN c:CalculateBtu()
(SETQ Cnt 1
TotalRFactor 0
)
(REPEAT 10
(SETQ Prompt (STRCAT “\nEnter the R value for material # “
(Itoa Cnt)
)
TotalRFactor ( +
(GETREAL Prompt)
TotalRFactor
)
Cnt (1+ Cnt)
OutAirTemp (GETREAL “\nEnter outside Air Temp : “)
InAirTemp (GETREAL “\nEnter inside Air Temp : “)
WallLength (GETREAL “\nEnter wall length : “)
WallHeight (GETREAL “\nEnter wall height : “)
WallArea ( * WallLength WallHeight)
Ufactor (/ 1.0 TotalRFactor)
DeltaTemp (ABS (- OutAirTemp InAirTemp))
BtuPerHour (* WallArea Ufactor DeltaTemp)
)
)
;**********************************************
;
;
; New Section for writing Result to either the screen
; or an ASCII Text file.
;
;
;**********************************************
(SETQ Answer (GETSTRING “\nWrite results to either a ile or raphic
screen : “)
)
(IF (OR (= Answer “F”) (= Answer “f”)
(PROGN
(SETQ File1 (OPEN “OutPut.Txt” “w”))
(Write-Line BtuPerHour File1)
(Close file1)
)
(PROGN
(PRINC (STRCAT “\nThe total btu per hour heat loss is “
(RTOS BtuPerHour)
)
)
(PRINC)
)
)
Chapter Five