As far as syntax, you should lay it out like:
-----------
(if (and (< px1 qx1)(= ab 1))
(progn
(command "_.pline" ti2 vert horz "")
(command "text" "j" "mc" htxt ht "0" slopet)
(command "text" "j" "mc" vtxt ht "0" t3sl)
); progn
;; else
(progn
(command "_.pline" ti3 vert2 horz2 "")
(command "text" "j" "mc" htxt4 ht "0" slopet)
(command "text" "j" "mc" vtxt4 ht "0" t3sl)
); progn
); if
;;
(if (and (> px1 qx1)(= ab 1))
(progn
(command "_.pline" ti2 vert horz1 "")
(command "text" "j" "mc" htxt2 ht "0" slopet)
(command "text" "j" "mc" vtxt2 ht "0" t3sl)
); progn
;; else
(progn
(command "_.pline" ti3 vert2 horz2 "")
(command "text" "j" "mc" htxt4 ht "0" slopet)
(command "text" "j" "mc" vtxt3 ht "0" t3sl)
); progn
); if -- Writes slope to dwg [1]
As for the 'logic' .. in above, one or the other
group of code will fire when ab=1 unless px1=qx1.
If you list the 'results' for:
(> px1 qx1)
.. do this
(< px1 qx1)
.. do this
and
(= px1 qx1)
.. do this (if anything),
it may help you determine what the code
needs to look like.
Bob