得到错误消息的原因是无法将SS作为参数提供给ssget函数,
查看Lee Mac关于ssget的教程/参考(围栏示例)。
从那里引用:
方法
其中pL-表示点列表(点列表)
ssfL-表示ssget筛选器列表-点对的assoc列表[可选]
因此,我将迭代“ssj”,并使用ssmemb排除不在“ss1”中的实体,将它们分组在“news”中:
- (if
- (and
- (setq ssj (ssget "_F" (list p1 p2 p3 p4))) ; I guess you want the fence through the points, not just the endpoints
- (setq newSS (ssadd)) ; create new empty selection set
- )
- (progn ; iterate over the "ssj" and grip the "newSS"
- (repeat (setq index (sslength ssj))
- (setq ent (ssname ssj (setq index (1- index)))) ; nth entity of the selection set
- (if (ssmemb ent ss1) (ssadd ent newSS)) ; if that entity is inside the "ss1", then collect it in "newSS"
- ); repeat
- (sssetfirst nil newSS) ; grip "newSS"
- ); progn
- ); if
但是,如果我们知道“ss1”的过滤标准是什么,那么仅仅一次迭代就足够了。 |