Jump to content

Help for modify my lisp


hosyn

Recommended Posts

I have this routine for filter block with select sample block :

(defun c:fbn ( / blockname sset); filter all blocks of same name
 (setq blockname (cdr (assoc 2 (entget (car (entsel))))))
 (setq sset (ssget (list (cons 2 blockname))))
 (sssetfirst sset sset)
 (princ (strcat "\nSelected " (itoa (sslength sset)) " instances of block \"" blockname "\"."))
 (princ)
)

,and how can i select same filtering via the name of block for example the name of block "blockname1" can i exacted this lisp via this command:

(c:fbn(blockname1))

o:)

Link to comment
Share on other sites

(defun fbn (blockname / sset)
 (setq sset (ssget (list (cons 2 blockname))))
 (sssetfirst nil sset)
 (princ (strcat "\nSelected " (itoa (sslength sset)) " instances of block \"" blockname "\"."))
 (princ)
)

;;; Example : (fbn "blockname1") ;;;

Link to comment
Share on other sites

THAXXXX GREEAAT Mr marko_ribar

If i wanna explode selected block how do i do ??It's right to add ::

(fbn "blockname1")
(command "_explode")

 

I add it but didn't do well?

Edited by hosyn
Link to comment
Share on other sites

7o7 Last object may not be the block

Hosyn like my other post to you explode using object

 

(setq blockname (cdr (assoc 2 (entget (car (entsel))))))
; now
(setq obj (car (entsel)))
(setq blockname (cdr (assoc 2 (entget obj))))

(command "explode" obj "") 

Edited by BIGAL
explode not erase
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...