Guest lesliematt Posted July 15, 2010 Posted July 15, 2010 Hello all, Say you have a list in autocad. It is a point on the screen (10, 10, 10) and its variable name is pLL. I want to use the point as a reference for drawing a circle 0.6 to the right, and a user defined variable 'depth' minus 0.227. See the attached file for a better picture. This is what I am trying and it isn't working for some reason. "_.circle" (mapcar '- pLL '(-0.6 (- depth 0.227) 0)) 0.125 I have also tried to extract each number from the pLL list seperatly, do the math, but am not sure how to put it back into a list to use as a mid-point for a circle. (setq ax (- 0.6 (car pLL))) (setq ay (- depth 0.227 (cadr pLL))) These work to get the math done, but I need to rebuild a list and draw a circle on that coordinate. Quote
alanjt Posted July 15, 2010 Posted July 15, 2010 (defun foo (pt val) (if (eq 3 (length pt)) (list (car pt) (cadr pt) (+ (caddr pt) val)) ) ) eg. (foo '(0 0 0) -3) -> '(0 0 -3) Quote
Guest lesliematt Posted July 15, 2010 Posted July 15, 2010 (defun foo (pt val) (if (eq 3 (length pt)) (list (car pt) (cadr pt) (+ (caddr pt) val)) ) ) eg. (foo '(0 0 0) -3) -> '(0 0 -3) I don't understand how I can use that for what I am doing. Would it work like this? (defun foo (pt val) (if (eq 3 (length pt)) (list (car pt) (cadr pt) (+ (caddr pt) val)) ) ) (foo '(pLL) - 0.6 (- fl 0.227) 0)) And it would change pLL to suit it?? Then what is the new lists name? I have never used foo before. Quote
alanjt Posted July 15, 2010 Posted July 15, 2010 (foo PLL #) # being the number you wish to add/subtract from the Z value of PLL. Look at my original example. Quote
alanjt Posted July 15, 2010 Posted July 15, 2010 Oops, I'm a 'tard - completely read your post wrong. (defun foo (pt xyzLSt) (if (equal '(3 3) (mapcar 'length (list pt xyzLst))) (mapcar '(lambda (a b) (+ a b)) pt xyzLst) ) ) eg Command: (foo '(1 1 1) '(1 2 0)) (2 3 1) Quote
Guest lesliematt Posted July 16, 2010 Posted July 16, 2010 Oops, I'm a 'tard - completely read your post wrong. (defun foo (pt xyzLSt) (if (equal '(3 3) (mapcar 'length (list pt xyzLst))) (mapcar '(lambda (a b) (+ a b)) pt xyzLst) ) ) eg Command: (foo '(1 1 1) '(1 2 0)) (2 3 1) Thanks, I was gonna say that I didn't wanna change my z. But you got it. Thanks again I will try it in the morn. 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.