Jump to content

code stop executing in (command) function


samifox

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 [b]sat [/b](entsel)) [b][color="red"]OR [/color][/b](setq [b]sat [/b](ssget))
(command "layiso" [b]sat [/b]"")

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...