lonie Posted October 19, 2009 Posted October 19, 2009 I use a lisp that moves a body around a poly line; it does this in a sort of stepped animation. I would like to modify the list so that it leaves body prints behind. Being new to lisps I can't work out how to do this. I've attached the lisp i use. The jpg shows what I'm after if I can get a modified lisp to run. What am I missing ? mst (ssg).lisp.txt Quote
NBC Posted October 19, 2009 Posted October 19, 2009 In that lsp, can't you just substitute Copy in place of Move ? Quote
lonie Posted October 19, 2009 Author Posted October 19, 2009 Tried it, no joy. I think that the last last step is erased as the body is steeped around pline Quote
lpseifert Posted October 19, 2009 Posted October 19, 2009 not tested... try commenting out the erase entlast and try copy as NBC suggested Quote
lonie Posted October 19, 2009 Author Posted October 19, 2009 Still just steps it around, without leaving a copy. Quote
CarlB Posted October 19, 2009 Posted October 19, 2009 I didn't see where the routine uses actual vehicle turning theory (I may have missed it in my quick look). And the path shown doesn't look like what a vehicle would sweep around a turn. The outside rear should not bump out, and there should be more sweep to the inside. The lisp creator should check out the theory and a lisp at: http://www.hawsedc.com/gnu/turntheo.php http://www.hawsedc.com/gnu/turn.php Quote
alanjt Posted October 19, 2009 Posted October 19, 2009 I 100% agree with Carl. However, maybe that there's another intention. Personally, I've always liked AutoTurn. However, you asked for a fix, so try this (replace this subroutine): (defun MoveStep() (repeat (length pL) (setq p3 (nth j pL)) (setq pa3 (vlax-curve-getParamAtPoint cur p3)) (if (>= (* flag pa3) (* flag pa1)) (progn (command "circle" p3 r) (setq ipL (ints cur (entlast))) (if (> (length ipL) 1) (setq p4 (getnearP p1 (car ipL) (cadr ipL))) (setq p4 (car ipL)) ) [color=Red];(command "erase" (entlast) "") [color=Lime]<-commented out[/color][/color] (command [color=Red]"copy"[/color] ob "" p1 p3) [color=Lime]<-changed from move to copy[/color] (command "rotate" ob "" p3 (rtd (- (angle p3 p4) ag))) (setq p1 p3 ag (angle p3 p4)) (command "delay" 100) ) ) (setq j (1+ j)) ) ) Quote
lonie Posted October 20, 2009 Author Posted October 20, 2009 Hi Carl / Alanjt, The body is in fact a car shell that is swept / stepped around a conveyor. The two circles inside the body must be constantly on the pline. I use it to explain how a body moves around on conveyors for clash detection. I cut and pasted the mod in with no joy. Quote
alanjt Posted October 20, 2009 Posted October 20, 2009 I cut and pasted the mod in with no joy. How ambiguous. Could you not make it work or did it not give you the desired results. The more information you give, the easier it is to help. It copied everything for me. Quote
lonie Posted October 20, 2009 Author Posted October 20, 2009 Have ran the lisp and this is what I get, it does leave a copy but doesn't follow the path. Quote
lonie Posted October 21, 2009 Author Posted October 21, 2009 Finally got it to work, inserted copy after it aligned itself. Just to close off the thread I've shown the change. Thanks ;;;------------------------------------------------------------------------------ (defun moveStep() (repeat (length pL) (setq p3 (nth j pL)) (setq pa3 (vlax-curve-getParamAtPoint cur p3)) (if (>= (* flag pa3) (* flag pa1)) (progn (command "circle" p3 r) (setq ipL (ints cur (entlast))) (if (> (length ipL) 1) (setq p4 (getnearP p1 (car ipL) (cadr ipL))) (setq p4 (car ipL)) ) (command "erase" (entlast) "") (command "move" ob "" p1 p3) (command "rotate" ob "" p3 (rtd (- (angle p3 p4) ag))) (setq p1 p3 ag (angle p3 p4)) (command "copy" ob "" p1 p3) ;inserted copy after the block is aligned (command "delay" 100) ) ) (setq j (1+ j)) ) ) ;;;===================MAIN==================== Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.