乐筑天下

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

[编程交流] code stop executing in (comma

[复制链接]

218

主题

699

帖子

483

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1090
发表于 2022-7-5 23:58:52 | 显示全部楼层 |阅读模式
Hi
 
my program stop when executing (command) function. what im doing wrong?
 
  1. (defun unlockAllLayers () (princ "/nunlock all layers") T )(defun deleteEntityLimit (units) (princ (strcat   "/nDelete line or poly if length is less than " (rtos units))) T )(defun setIsolateMode (mode)(if (= mode 0)  (progn    (princ "/nIsolate mode was set to Off")    (command "layiso" "S" "O" "" )))(if (= mode 1)  (progn    (princ "/nIsolate mode was set to Lock and fade")    (command "layiso" "S" "L" "" ))) T)(defun C:TEST (/ q yn) (if (unlockAllLayers)   (if        (setIsolateMode 1)     (progn(setq q (getvar 'qaflags))(princ "/nIsolating...")(command "layiso" "")(setvar 'qaflags q)(initget "Yes No")(if (setq yn (getString "Do you want to proceed? Yes/No"))  (if (= yn "Y")    (alert "Yes")    (alert "No")  ))     )   ) ))
 
Thanks
Shay
回复

使用道具 举报

55

主题

402

帖子

357

银币

后起之秀

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

铜币
274
发表于 2022-7-6 00:19:55 | 显示全部楼层
Try "-layiso"
回复

使用道具 举报

218

主题

699

帖子

483

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1090
发表于 2022-7-6 00:30:25 | 显示全部楼层
why is that? what is the different?
回复

使用道具 举报

1

主题

475

帖子

481

银币

初来乍到

Rank: 1

铜币
5
发表于 2022-7-6 00:42:01 | 显示全部楼层
samifox,
this is not not generating error but it is unnecessary
  1. (setq q (getvar 'qaflags));; store the qaflags value to the q variable(setvar 'qaflags q);; sets the q value to the qaflags sysvar ???
this is generating the error
  1. (command "layiso" "");; you must supply the "layiso" command with a selection set (ssget) or an ename (car (entsel))
HTH
Henrique
回复

使用道具 举报

55

主题

402

帖子

357

银币

后起之秀

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

铜币
274
发表于 2022-7-6 00:58:15 | 显示全部楼层
Sorry Shay,
I read this post on my cell phone, and didnt check your code completely....
 
You didnt mentioned any object set or selection set anywhere in your code, you need to pass some selection set,
e.g.
  1. (setq [b]sat [/b](entsel)) [b][color="red"]OR [/color][/b](setq [b]sat [/b](ssget))(command "layiso" [b]sat [/b]"")
回复

使用道具 举报

218

主题

699

帖子

483

银币

顶梁支柱

Rank: 50Rank: 50

铜币
1090
发表于 2022-7-6 01:10:17 | 显示全部楼层
:oops:
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-7-6 10:40 , Processed in 0.647077 second(s), 65 queries .

© 2020-2025 乐筑天下

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