Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

getpoint problem with otrack

3 REPLIES 3
Reply
Message 1 of 4
amjarch
320 Views, 3 Replies

getpoint problem with otrack

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
3 REPLIES 3
Message 2 of 4
amjarch
in reply to: amjarch

Forgot to mention...this works fine if i am not tracking to the insertion point. if i am inserting at, say, the mid point it works like a charm.

Thanks,
Drew
Message 3 of 4
amjarch
in reply to: amjarch

One more thing, sorry to all. When the second ucs change takes place with the wrong "pnt0" it only works (by works i mean finish the routine) if the first assigned ucs origin--the 0,0,0 point---is in the visible area of the screen. If it is not on the screen i get some message about the points are coplainer and i need to maually put in the y axis or direction by hand.

what is going on here that i am missing?

Thanks again and again,
DRew
Message 4 of 4
gustavobernardi
in reply to: amjarch

A solution for this?

 

Tks

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost