Jump to content

Drawing Circle on List Coordinate


Recommended Posts

Guest lesliematt
Posted

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.

Holes.jpg

Posted

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

Guest lesliematt
Posted
(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.

Posted

(foo PLL #)

# being the number you wish to add/subtract from the Z value of PLL.

 

Look at my original example.

Posted

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)

Guest lesliematt
Posted
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.

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