Block rename LISP on German

Block rename LISP on German

andelo523
Enthusiast Enthusiast
939 Views
3 Replies
Message 1 of 4

Block rename LISP on German

andelo523
Enthusiast
Enthusiast

Hello,

 

So, I got this wonderful LISP File with whom I can easily rename Blocks just by selecting the Block, and then typing the new name for the block. It works perfectly on my English AutoCAD, but my colleagues have AutoCAD on German, and it doesn't work there. I tried to put German commands to the LISP, but I didn't get it to work. Can someone Help me to modify the LISP for the German AutoCAD?

 

Thanks in Advance!

 

;; RB.lsp  v1.0
;;
;; Copyright (c) 1998 by Innovative Programming
;; All Rights Reserved
;;
;; TERMS & AGREEMENT
;;   Permission to use, copy, modify, and distribute this software
;;   for any purpose and without fee is hereby granted, provided
;;   that the above copyright notice appears in all copies and that
;;   both copyright notice and this permission notice appears in
;;   all supporting documentation.
;;
;;   ANY USE OF THIS SOFTWARE IS AT YOUR OWN RISK AND IT IS PROVIDED
;;   "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.  ALL IMPLIED WARRANTIES
;;   OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF MERCHANTABILITY ARE
;;   HEREBY DISCLAIMED.  NO LIABILITY FOR CONSEQUENTIAL DAMAGES.  IN NO
;;   EVENT SHALL INNOVATIVE PROGRAMMING BE LIABLE FOR INCIDENTAL,
;;   INDIRECT, OR CONSEQUENTIAL DAMAGES (INCLUDING, WITHOUT LIMITATION,
;;   DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS
;;   OF BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) AS A RESULT
;;   OF THE USE OF OR INABILITY TO USE THIS SOFTWARE.
;;
;; PURPOSE:
;;   Rename user selected block.
;;
;; OTHER NOTES:
;;   None
;;
;; FUTURE REVISIONS:
;;   None
;;
;; REVISIONS:
;;   1.0  9/14/98  Released
;;
(defun C:RB (/ SB SBD OLD_NAME NEW_NAME)
 (setq SB NIL)
 (while (null SB)
   (setq SB (entsel "\nSelect block to RENAME: "))
   (if SB
     (progn (setq SB  (car SB)
                  SBD (entget SB)
            )
            (if (= (cdr (assoc 0 SBD)) "INSERT")
              (redraw SB)
              (progn (redraw SB)
                     (setq SB NIL)
                     (princ "\nItem selected is not a block.")
              )
            )
     )
     (princ "\nNothing selected.  Try again.")
   )
 )
 (setq OLD_NAME (cdr (assoc 2 SBD)))
 (princ (strcat "\n OLD Block Name: " OLD_NAME))
 (setq NEW_NAME (getstring "\n NEW Block Name: "))
 (command "rename" "b" OLD_NAME NEW_NAME)
 (princ (strcat "\n BLOCK RENAMED TO: " NEW_NAME))
 (princ)
)
(princ "\nRBLOCK Loaded.  Type RBLOCK to Start.")
(princ)
 Quote
GP_
Rising Star
GP_
Community Members
 14
311 posts
AutoCAD  2017
Posted May 20, 2013
My version, also for Dynamic&Anonymous blocks. :)

 

;;; file: RB_en.lsp                                                 ;;;
;;; data: 22/10/2008                                                ;;;
;;; note: Rename the selected block.                                ;;;
;;;                                                                 ;;;
;;; aggiornamento: (Versione 2) - 01/04/2009                        ;;;
;;;              - default sulla casella OK                         ;;;
;;;              - controllo esistenza nome blocco                  ;;;
;;;                                                                 ;;;
;;; aggiornamento: (Versione 3) - 02/04/2009                        ;;;
;;;              - allargata casella editazione nome blocco         ;;;
;;;                                                                 ;;;
;;; aggiornamento: (Versione 4) - 28/10/2012                        ;;;
;;;              - rinomina blocchi dinamici e blocchi anonimi      ;;;
;;;              - creazione di blocchi anonimi                     ;;;
;;;              - inglobamento DCL nel lisp                        ;;;
;;;                                                                 ;;;
;;; aggiornamento: (V. 4_en) - 20/05/2013                           ;;;
;;;              - English Version (for CADTutor)                   ;;;
;;;                                                                 ;;;
;;; autore: Gian Paolo Cattaneo                                     ;;;


(defun c:RB (/ :bb old new dcl_id)
0 Likes
Accepted solutions (2)
940 Views
3 Replies
Replies (3)
Message 2 of 4

J-Rocks
Collaborator
Collaborator
Accepted solution

I am using this program written by Mr. Tharwat 

https://www.cadtutor.net/forum/topic/65842-rename-a-block/

Message 3 of 4

ВeekeeCZ
Consultant
Consultant
Accepted solution

I agree that you should find some free alternatives that are not protected by this (c) nonsense. The routine is so simple that you could find literally dozens of free alternatives.

 

Anyway, the only issue I see is the following line, which should work good modified like this:

(command "_.-rename" "_b" OLD_NAME NEW_NAME)

 

Also, there are plenty of lines that should not be part of your lsp file:


@andelo523 wrote:

 

....
 Quote
GP_
Rising Star
GP_
Community Members
 14
311 posts
AutoCAD  2017
Posted May 20, 2013
My version, also for Dynamic&Anonymous blocks. :)
...

 

Message 4 of 4

andelo523
Enthusiast
Enthusiast

Wow, you're really awesome guys!! Smiley Very Happy

 

@ВeekeeCZ I've changed the line you wrote in the LISP, and now it works even with German AutoCAD. Thank you very much!

 

@J-Rocks The Programm is even better than the LISP. Thanks for your reply too!

 

Best Regards!