Trai Posted June 30, 2022 Posted June 30, 2022 HI THERE, recently, I have an issue about block in my drawing. I have a file have many "anonymous block" . So I want to edit them without go to block editor then explode them. I only edit them when I explode them. Someone can help me a lips to fix that Thank you for your time to help me !. This is an example file T8_A3.dwg Quote
confutatis Posted June 30, 2022 Posted June 30, 2022 https://blog.draftsperson.net/anonymous-blocks-in-autocad/ 1 Quote
mhupp Posted June 30, 2022 Posted June 30, 2022 This seems to do the trick. I would use with caution. (defun c:ub () (vlax-for bl (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object))) (setq nam (vla-get-name bl)) (if (= "*U" (substr nam 1 2)) (progn (setq nam2 (substr nam 2)) (vla-put-name bl nam2) (princ (strcat "\n" nam " ---> " nam2)) ) ) ) (princ) ) 1 Quote
tombu Posted July 1, 2022 Posted July 1, 2022 On 6/30/2022 at 2:17 AM, mhupp said: This seems to do the trick. I would use with caution. UnAnon.Lsp assigns block names after checking to make sure the names aren't already in use, no caution needed. They can be renamed afterwards. Before Vehicle Tracking we used to use AutoTurn for vehicle paths and it made each of them an anonymous block, used UnAnon.Lsp for many years to fix them and hatches from many many earlier before they were improved which was probably what the lisp was created for in 1998. Might be the oldest routine I still use today, I've seen newer simular code but why fix something that's worked for me for so long? 1 Quote
mhupp Posted July 1, 2022 Posted July 1, 2022 12 minutes ago, tombu said: UnAnon.Lsp assigns block names after checking to make sure the names aren't already in use, no caution needed. I was saying that more for the fact they are anonymous blocks for a reason and/or could mess something when they aren't anymore. And it does the whole drawing. rather than process the ones you select. 1 Quote
Saqib Posted June 4 Posted June 4 On 6/30/2022 at 9:17 AM, mhupp said: This seems to do the trick. I would use with caution. (defun c:ub () (vlax-for bl (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object))) (setq nam (vla-get-name bl)) (if (= "*U" (substr nam 1 2)) (progn (setq nam2 (substr nam 2)) (vla-put-name bl nam2) (princ (strcat "\n" nam " ---> " nam2)) ) ) ) (princ) ) Hi, how to make this lisp work only on selected blocks. Quote
SLW210 Posted June 6 Posted June 6 On 6/4/2024 at 8:54 AM, Saqib said: Hi, how to make this lisp work only on selected blocks. What are you trying to do? The UnAnon.lsp linked in 2nd post is selection unless you use UnanonAll option AFAIK. 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.