Jump to content

Anon Blocks


ChristopherM

Recommended Posts

Hi

 

I got a file from someone else with a lot of blocks and they are all anon. I don't have access to the original blocks or anything.

 

I have did Burst 1 block and remade it Workplace. Now is there a way I can replace all the other 100 Anon blocks with this Workplace block easy ?

 

I tried Blockreplace but it doesn't let me select the anon blocks. Any other command I can try ? Or will I have to replace the blocks manually ?

 

Thanks

Link to comment
Share on other sites

Any help on how to select them ? Quickselect one by one ? Any method to select them all at once ? I have seen some SSGET command thingi but didnt understand it

Link to comment
Share on other sites

Try the attached lisp routine created by Patrick Hughes of CadTempo. I have no idea if it works or not as I did not bother to test it. That's your job.

 

Reinsert.lsp

 

It will prompt for a block name (the replacement block) then allow you to select single, or multiple.

 

Addendum: You'll need the LispUtil.lsp routine available in post #9 below too.

Edited by ReMark
Link to comment
Share on other sites

they star with U

 

And I tried this : (ssget '((2 . "`*U*"))) but that just selected them without the possiblity of me doing anything more afterwards. It keeps asking for objects to select. if I press esc I lose the selection. Didn't understand it right i think...

 

and QSelect I tried to use *U by Wildcard Match but that didnt work either...

Link to comment
Share on other sites

Well....did it work or not?

 

I thought by now you would have gotten back to us with the results.

 

Addendum: You'll need the LispUtil.lsp routine available in post #9 below too.

Edited by ReMark
Link to comment
Share on other sites

Try the attached lisp routine created by Patrick Hughes of CadTempo. I have no idea if it works or not as I did not bother to test it. That's your job.

 

[ATTACH]55714[/ATTACH]

 

It will prompt for a block name (the replacement block) then allow you to select single, or multiple.

It loads, but will not run.

 

Command: RINSERT

; error: no function definition: USTR

 

I've always used:

;=============================================== 
;    UnAnon.Lsp                                   Jul 05, 1998 
;====================================== 
(princ "\nCopyright (C) 1998, Fabricated Designs, Inc.") 
(princ "\nLoading UnAnon v1.0 ") 
(setq uan_ nil lsp_file "UnAnon") 

;================== For Automated Calling From Another Program ========= 
(defun uan_auto (ar1) (UnAnon ar1)) 

;================== Macros ============================================= 
(defun PDot ()(princ ".")) 

(PDot);++++++++++++ Set Modes & Error ++++++++++++++++++++++++++++++++++ 
(defun uan_smd () 
(SetUndo) 
(setq olderr *error* 
     *error* (lambda (e) 
               (and (/= e "quit / exit abort") 
                    (princ (strcat "\nError: *** " e " *** "))) 
               (command "_.UNDO" "_END" "_.U") 
               (uan_rmd)) 
      uan_var '( 
 ("CMDECHO"   . 0) ("MENUECHO" . 0) ("MENUCTL"   . 0) ("MACROTRACE" . 0) 
 ("OSMODE"    . 0) ("SORTENTS" . 119)("MODEMACRO" . ".") 
 ("BLIPMODE"  . 0) ("EXPERT"   . 0) ("SNAPMODE"  . 1) ("PLINEWID"   . 0.0) 
 ("ORTHOMODE" . 1) ("GRIDMODE" . 0) ("ELEVATION" . 0) ("THICKNESS"  . 0) 
 ("FILEDIA"   . 0) ("FILLMODE" . 0) ("SPLFRAME"  . 0) ("UNITMODE"   . 0) 
 ("TEXTEVAL"  . 0) ("ATTDIA"   . 0) ("AFLAGS"    . 0) ("ATTREQ"     . 1) 
 ("ATTMODE"   . 1) ("UCSICON"  . 1) ("HIGHLIGHT" . 1) ("REGENMODE"  . 1) 
 ("COORDS"    . 2) ("DRAGMODE" . 2) ("DIMZIN"    . 1) ("PDMODE"     . 0) 
 ("CECOLOR"   . "BYLAYER") ("CELTYPE" . "BYLAYER"))) 
(foreach v uan_var 
     (setq m_v (cons (getvar (car v)) m_v) 
           m_n (cons (car v) m_n)) 
     (setvar (car v) (cdr v))) 
(princ (strcat (getvar "PLATFORM") " Release " (substr (ver) 18 2) 
  " -  Convert To Anonymous Blocks ....\n")) 
(princ)) 

(PDot);++++++++++++ Return Modes & Error +++++++++++++++++++++++++++++++ 
(defun uan_rmd () 
 (setq *error* olderr) 
 (mapcar 'setvar m_n m_v) 
 (command "_.UNDO" "_END") 
 (prin1)) 

(PDot);++++++++++++ Set And Start An Undo Group ++++++++++++++++++++++++ 
(defun SetUndo () 
(and (zerop (getvar "UNDOCTL")) 
     (command "_.UNDO" "_ALL")) 
(and (= (logand (getvar "UNDOCTL") 2) 2) 
     (command "_.UNDO" "_CONTROL" "_ALL")) 
(and (= (logand (getvar "UNDOCTL")  8) 
     (command "_.UNDO" "_END")) 
(command "_.UNDO" "_GROUP")) 

(PDot);++++++++++++ Get Entity Name ++++++++++++++++++++++++++++++++++++ 
(defun GetOne (/ st os) 
(setq os (getvar "SNAPMODE") s nil) 
(setvar "SNAPMODE" 0) 
(while (not st) 
       (setq st (ssget))) 
(while (> (sslength st) 1) 
       (setq st nil) 
       (princ "\nOnly 1 At A Time Please\n") 
       (while (not st) 
              (setq st (ssget)))) 
(setvar "SNAPMODE" os) 
(setq s (ssname st 0))) 

(PDot);++++++++++++ Convert An Anonymous Block To Named Block ++++++++++ 
(defun UnAnon (b / tdef en ed bc bn bd in)          ;Supply ename 
 (setq bn "TEMP1" bc 1) 
 (while (tblsearch "BLOCK" bn) 
        (setq bc (1+ bc) bn (strcat "TEMP" (itoa bc)))) 
 (and (= (type b) 'ENAME) 
      (setq bd (entget b) 
            in (cdr (assoc 2 bd)))) 
 (if (or (not bd) 
         (not in) 
         (/= "INSERT" (cdr (assoc 0 bd))) 
         (/= "*U" (substr in 1 2)) 
         (= (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 An Anonomymous Block *** ") 
        (setq bn nil bc nil 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 bn) 
                (cons 70 0) 
                (cons 10 (cdr (assoc 10 tdef))))) 
 (entmake ed) 
 (while (setq en (entnext en)) 
        (setq ed (entget en)) 
        (entmake ed)) 
 (entmake (list (cons 0 "ENDBLK"))) 
 (setq bd (subst (cons 2 bn) (assoc 2 bd) bd)) 
 (entmod bd) 
 (entupd b) 
 (princ (strcat "\n" bn))) 

(PDot);************ Main Program *************************************** 
(defun uan_ (/ m_v m_n olderr uan_var s) 
 (uan_smd) 
 (GetOne) 
 (UnAnon s) 
 (uan_rmd)) 

(defun c:UnAnonall (/ ss i) 
(setq ss (ssget "X" (list (cons 0 "INSERT")(cons 67 (if (= (getvar "TILEMODE") 1) 0 1))))) 
(and ss 
  (setq i (sslength ss)) 
  (while (not (minusp (setq i (1- i)))) 
         (setq en (ssname ss i)) 
         (if (= "*U" (substr (cdr (assoc 2 (entget en))) 1 2)) 
             (UnAnon en)))) 
(prin1)) 

(PDot);************ Load Program *************************************** 
(defun C:UnAnon () (uan_)) 
(if uan_ (princ "\nUnAnon Loaded\n")) 
(prin1) 
;================== End Program ======================================== 

It prompts for multiple selection, but only seems to work for single selection. Curious if anyone has something newer and spiffier. Our AutoTurn software outputs simulations as unano blocks which I have to convert to plot correctly.

 

Oops! Sorry I misread the question. Try: https://forums.autodesk.com/t5/autocad-2013-2014-2015-2016/make-annotative-blocks-non-annotative/td-p/3745531

Link to comment
Share on other sites

Well that sucks. Took some effort just to track that one down. Yes, I'm familiar with UnAnon.lsp but I didn't think it quite fit the OP's needs.

 

Addendum: In my haste I neglect to download and make available the lisp routine below which is required for the proper functioning of the Reinsert lisp routine (amongst others available at Patrick Hughes website). My bad. Here it is...

 

LispUtil.lsp

 

Description:LISP utilities from New Riders Publishing combined into one file. Required for proper functioning of the noted programs. Includes several user defined "get" functions and BATCHSCR.LSP which allows simple script writing via MSCRIPT.LSP

Edited by ReMark
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...