Jump to content

Make Block Unique


JBullseye74

Recommended Posts

thought i'd share this gem with you all.......

 

there is a command in Sketchup where you can make a block unique, now i quite often have situations where i would like this command in autocad and you have to go into block editor and save is and its a real painful slow process.

 

So i had a quick search on the internet and trumbled across this, someone found out that if you use the flatten command on a block it gives it a sufix of -flat-1 in the block name thus making it unique. Also if you do it again on the first block it automatically renumbers it the next one -flat-2 and so on and so forth.

 

Hope this helps yall. :D

Link to comment
Share on other sites

You can also copy geometry and right click 'Paste as Block' to create anonymous blocks on the fly (In your case you would need to explode the block first)

Link to comment
Share on other sites

You can also copy geometry and right click 'Paste as Block' to create anonymous blocks on the fly (In your case you would need to explode the block first)

 

Blocks created by "Paste as Block" are not ANONYMOUS blocks. Two completely different things. When you "Paste as Block" a block needs a name, so AutoCAD creates a random and unique name.

Link to comment
Share on other sites

Here''s function that will convert a standard block INSERT into an anonymous block INSERT:

 

;;;ARG -> Standard INSERT ename
;;;RET -> T nil
(defun anon (b / tdef en ed bn bd in)
 (and (= (type b) 'ENAME)
      (setq bd (entget b)
            in (cdr (assoc 2 bd))))
 (if (or (not bd)
         (not in)
         (/= "INSERT" (cdr (assoc 0 bd)))
         (= "*" (substr in 1 1))
         (= (logand (cdr (assoc 70 (tblsearch "BLOCK" in)))  4)  4)
         (= (logand (cdr (assoc 70 (tblsearch "BLOCK" in))) 16) 16)
         (= (logand (cdr (assoc 70 (tblsearch "BLOCK" in))) 32) 32))
      (progn
        (princ "*** Not A Changeable Block *** ")
        (setq bd nil in nil b nil)
        (exit)))
 (setq tdef (tblsearch "BLOCK" in)
         en (cdr (assoc -2 tdef))
         ed (entget en))
 (entmake (list (cons 0 "BLOCK")
                (cons 2 "*U")
                (cons 70 1)
                (cons 10 (cdr (assoc 10 tdef)))))
 (entmake ed)
 (while (setq en (entnext en))
        (setq ed (entget en))
        (entmake ed))
 (setq bn (entmake (list (cons 0 "ENDBLK"))))
 (setq bd (subst (cons 2 bn) (assoc 2 bd) bd))
 (entmod bd)
 (entupd b))

 

-David

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