muthu123 发表于 2022-7-6 11:38:47

please help - function returns

i have copied the following result from console window. If you look at it the pt1 is part of the purlin_ins_pt_list_left. But when i use the function member it returns nil. Please suggest the correct way.

_$ pt1(8955.33 6895.53 0.0)_$ purlin_ins_pt_list_left((1492.56 6149.26 0.0) (2985.11 6298.51 0.0) (4477.67 6447.77 0.0) (5970.22 6597.02 0.0) (7462.78 6746.28 0.0) (8955.33 6895.53 0.0) (10447.9 7044.79 0.0) (11940.4 7194.04 0.0) (13433.0 7343.3 0.0) (14925.6 7492.56 0.0))_$ (member pt1 purlin_ins_pt_list_left)nil_$

jammie 发表于 2022-7-6 12:09:43

It could be the precision of either pt1 or purlin_ins_pt_list_left
 
 
The concept is correct though
 

(setq pt1 '(8955.33 6895.53 0.0))(setq purlin_ins_pt_list_left '((1492.56 6149.26 0.0) (2985.11 6298.51 0.0) (4477.67 6447.77 0.0) (5970.22 6597.02 0.0) (7462.78 6746.28 0.0) (8955.33 6895.53 0.0) (10447.9 7044.79 0.0) (11940.4 7194.04 0.0) (13433.0 7343.3 0.0) (14925.6 7492.56 0.0)))(member pt1 purlin_ins_pt_list_left)

David Bethel 发表于 2022-7-6 12:45:07

( member ) looks for exact matches so Jammie is probably correct with the precession query
 
I'd try something like this:

(setq found nil)(foreach ppurlin_ins_pt_list_left(and (equal p pt1 1e-4)       (setq found T)))found
 
-David
页: [1]
查看完整版本: please help - function returns