乐筑天下

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

[编程交流] ssget using entity type & poin

[复制链接]

49

主题

177

帖子

130

银币

后起之秀

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

铜币
243
发表于 2022-7-5 23:34:16 | 显示全部楼层 |阅读模式
I have this expression
 
(setq myvar (ssget "X" '((0 . "LINE") (10 5 3 2))))
 
It makes a selection of all lines starting from this point x=5, y=3, z=2.
However when I get the values of 5,3,2 from an other command as variables e.g
 
(setq a 5 b 3 c 2)
 
the following gives me error "bad ssget list"
 
(setq myvar (ssget "X" '((0 . "LINE") (10 a b c))))
 
Would it be possible to avoid this and have the selection based on xyz points as variables rather than fixed known values?
回复

使用道具 举报

26

主题

1495

帖子

20

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
118
发表于 2022-7-6 00:05:17 | 显示全部楼层
The quote ' makes an expression literal ( not evaluated )
 
Try
  1. (setq myvar (ssget "X" (list (cons 0 "LINE")(cons 10 (list a b c)))))
 
or
  1. (setq myvar (ssget "X" (list (cons 0 "LINE")(list 10 a b c))))
 
-David
回复

使用道具 举报

49

主题

177

帖子

130

银币

后起之秀

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

铜币
243
发表于 2022-7-6 00:19:04 | 显示全部楼层
Thank you.
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 00:34:45 | 显示全部楼层
Further to David's excellent suggestion, here is a tutorial explaining why the quote cannot be used when there are expressions to be evaluated: The Apostrophe & Quote Function
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-11 00:33 , Processed in 0.983140 second(s), 60 queries .

© 2020-2025 乐筑天下

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