Matt O Posted August 14, 2023 Posted August 14, 2023 This has probably already been dealt with in the past but I can't find a post that helps me in this particular situation. I have a DXF file from an external source where all the blocks come into my drawing named "diag_cross". I would like to redefine the blocks but on a layer-dependant basis. For example, If the layer was named "757_TAP" then the redefine would need to be "diag_cross=tap" where ACAD would call file "tap". However, as redefine is a global statement, I need to be able to select as layer-name dependant. Ideally this would be an automated process if possible, rather than by selection. Quote
BIGAL Posted August 15, 2023 Posted August 15, 2023 Is the original dwg made from field survey ? If so way better to go back a few steps, CIV3D and for me Civil Site Design support read a field survey code and insert correct block on the point as well as stringing. Quote
Emmanuel Delay Posted August 17, 2023 Posted August 17, 2023 Well, you can't call a block "diag_cross=tap". No special characters (except a few). You can redefine the blockname of inserted blocks; that's no problem. Here's a test example: (defun rename_blockname (blockname newblockname / blklst) (vl-load-com) (setq blklst (vla-get-Blocks (vla-get-activedocument (vlax-get-acad-object)))) (vla-put-Name (vla-item blklst blockname) newblockname) ) (defun c:rdb ( / ss i blockname newblockname) (if (or (setq ss (ssget '((0 . "INSERT")))) (setq ss (ssget "_X" '((0 . "INSERT"))))) (progn (setq i 0) (repeat (sslength ss) (rename_blockname (setq blockname (cdr (assoc 2 (entget (ssname ss i))))) (setq newblockname (getstring (strcat "Block: " blockname ", set new name: "))) ) (setq i (+ i 1)) ) ) ) (princ) ) But I'm not sure what exactly you want. Quote
Recommended Posts
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.