Jump to content

Recommended Posts

Posted

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 ?

path.jpg

mst (ssg).lisp.txt

Posted

In that lsp, can't you just substitute Copy in place of Move ?

Posted

Tried it, no joy. I think that the last last step is erased as the body is steeped around pline

Posted

not tested...

try commenting out the erase entlast

and try copy as NBC suggested

Posted

Still just steps it around, without leaving a copy.

Posted

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))
)
)

Posted

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.

Posted

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.

Posted

Have ran the lisp and this is what I get, it does leave a copy but doesn't follow the path.

Presentation1.jpg

Posted

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====================

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...