乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 90|回复: 2

[编程交流] please help - function returns

[复制链接]

55

主题

133

帖子

78

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
280
发表于 2022-7-6 11:38:47 | 显示全部楼层 |阅读模式
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.
  1. _$ 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_$
回复

使用道具 举报

5

主题

194

帖子

193

银币

初来乍到

Rank: 1

铜币
24
发表于 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
 
  1. (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)
回复

使用道具 举报

26

主题

1495

帖子

20

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
118
发表于 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:
  1. (setq found nil)(foreach p  purlin_ins_pt_list_left  (and (equal p pt1 1e-4)       (setq found T)))found
 
-David
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-6 02:31 , Processed in 0.496706 second(s), 58 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表