samifox 发表于 2022-7-5 23:58:52

code stop executing in (comma

Hi
 
my program stop when executing (command) function. what im doing wrong?
 

(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

satishrajdev 发表于 2022-7-6 00:19:55

Try "-layiso"

samifox 发表于 2022-7-6 00:30:25

why is that? what is the different?

hmsilva 发表于 2022-7-6 00:42:01

samifox,
this is not not generating error but it is unnecessary

(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

(command "layiso" "");; you must supply the "layiso" command with a selection set (ssget) or an ename (car (entsel))
HTH
Henrique

satishrajdev 发表于 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.

(setq sat (entsel)) OR (setq sat (ssget))(command "layiso" sat "")

samifox 发表于 2022-7-6 01:10:17

:oops:
页: [1]
查看完整版本: code stop executing in (comma