TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: rude dog on March 15, 2004, 02:50:21 PM

Title: extract out pick point
Post by: rude dog on March 15, 2004, 02:50:21 PM
if ssnamex echoes this:
Code: [Select]

((1 <Entity name: 40069128> 0 (0 (34.0599 0.0 0.0))))


(34.0599 0.0 0.0)and this is this the pick point (i think?)how does one extract this out into a list (and setq its value)...with some type of a CxxxxR function? :?
Title: extract out pick point
Post by: rude dog on March 15, 2004, 02:56:53 PM
i know i could use a getpoint....but now im curious
Title: extract out pick point
Post by: SMadsen on March 15, 2004, 03:25:02 PM
The exact sequence would be something like

(cadr (cadddr (car lst)))

but dealing with return values from SSNAMEX it would be a good idea to check which kind of pick was made because the output varies. So first check the CAR element, for example:

Code: [Select]

(setq ssxlist (ssnamex sset a))

(if (= (car (setq slist (car ssxlist))) 1)
  (setq ppoint (cadar (reverse slist))))
Title: extract out pick point
Post by: rude dog on March 15, 2004, 03:37:03 PM
:)  wow...thanks I'll study it