Jump to content

Recommended Posts

Posted (edited)

Hello. I am completely new to writing code so apologies if code looks bad.
I am trying to write a Lisp that would select 2 named blocks after thawing and turning on all layers.

The problem is I get stuck in the Select Blocks command after it selects the 2 blocks.
If I press Enter, it just exits without the 2 selected blocks
 

(defun c:myMacro ()
  ; Thaw all layers
  (command "._LAYTHW" "all")

  ; Turn on all layers
  (command "._LAYON" "all")

  ; Select Blocks named A1 and A2
  (setq ss (ssget "_X" '((0 . "INSERT") (2 . "A1,A2"))))
  (if ss
    (command "_SELECT" ss)
  )

  (princ)
)


What exactly am I doing wrong here?

Edited by Colomon249

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...