I am fairly new to AutoLISP but i am picking it pretty quickly. I have my share of problems but this one i can't figure. Here is the section of the lisp that keeps mucking up:
;------------------------
; INSERT DOORS
;------------------------
(defun c:jdoor (/ clayer frstln ent pnt0 pnt1 pnt2)
(setq c_layer (getvar "clayer")
)
(setvar "coords" 2)
(if (not (tblsearch "layer" "A-DO-SWG"))
(command "layer" "m" "A-DO-SWG" "c" "27" "" "")
)
(if (not (tblsearch "layer" "A-DO"))
(command "layer" "m" "A-DO" "c" "5" "" "")
)
(setq frstln (entget(car(nentsel "\nSelect swing side of wall to insert door into:")))
ent (cdr(assoc -1 frstln))
)
(setvar "clayer" (cdr(assoc 8 frstln)))
(command "._ucs" "_ob" ent)
(setq pnt0 (getpoint "\nInsertion point - hinge point)?")
pnt1 (getpoint pnt0 "\nDirection of swing?")
pnt2 (getpoint pnt0 "\nDirection of opening?")
)
(command "._ucs" "_3" pnt0 pnt1 pnt2)
(princ)
)
;------------------------------------------
The problem is that when I am picking "pnt0" during the routine the ucs is rotated so that I can take advantage of the otrack to set the point, say 1'-0" away from the adjacent wall. When I do this though the point that gets stored in "pnt0" is the origin of the otracking (the intersection of two lines in this case) not the desired point. Then, when the routine is setting up the ucs, via the 3 point method, with those points everything is obviously wrong. Is this typical or am I just doing this wrong.
Thanks,
Drew