B2P Posted November 2, 2021 Posted November 2, 2021 Hi everyone. I have multiple files with various sheets that contain different texts located in the same position in each of them. My query is if there is any way to delete these texts from all sheets in multiple files without having to open them one by one and delete them manually. I hope you can help me. Thank you very much in advance. Quote
BIGAL Posted November 2, 2021 Posted November 2, 2021 There is accoreconsole that runs in windows operating system level and manipulates dwgs. Yes it could delete text at a point. The other way is using OBDX to manipulate dwgs without opening, 3rd is run a script yes it will open dwg but go to lunch you will be surprised how many it can do in a short time. 1 Quote
hosneyalaa Posted November 3, 2021 Posted November 3, 2021 Hi Attach a drawing as an example it would be better Quote
B2P Posted November 4, 2021 Author Posted November 4, 2021 Hi everyone, Thank you very much for the advice, graphically what I need can be better explained with the help of the following image: I have files with two or more layouts like the example in the image with a text that in some cases can say the same and in others not, but in all layouts it is located in the same position. In the example of the image it would be the text 3.- A1A1A1A1 on layout 1, and 3.- B2B2B2B2 on layout 2, what I'm looking for is a lisp or a script as recommended by BIGAL to help me delete the selected text in multiple files so you don't have to do it manually one by one. I hope I have explained myself better, in advance I appreciate all the help. Quote
BIGAL Posted November 4, 2021 Posted November 4, 2021 (edited) Ok pick the text any layout this returns the insert point then just do a erase in every layout. ; A little slow but works ; simple delete 1 text in a layout ; By Alan H Nov 2021 (defun c:1e ( / lay plotabs tabs tabname) (setq doc (vla-get-activedocument (vlax-get-acad-object))) (setq tabs (vla-get-Layouts (vla-get-activedocument (vlax-get-acad-object)))) (command "Pspace") (setq ent (entget (car (entsel "\nPick text ")))) (setq pt (cdr (assoc 10 ent))) (vlax-for lay tabs (setq tabname (vla-get-name lay)) (if (/= tabname "Model") (progn (setvar "ctab" tabname) (command "Pspace") (command "zoom" "e") (command "erase" pt "") ) ) ) (princ) ) (c:1e) Edited November 4, 2021 by BIGAL Quote
rlx Posted November 6, 2021 Posted November 6, 2021 just 4fun and also its been a while because of high workload at the moment ... RlxDbxDelTxt.lsp Quote
B2P Posted November 6, 2021 Author Posted November 6, 2021 Thank you both very much for the help, the routines work very well Quote
rlx Posted November 6, 2021 Posted November 6, 2021 you're welcome....fwiw , just modified one of my routines to do the job but normaly I would go with Bigal's approach : just make a script to cycle all tabs and erase point / window. Mine is faster (and looks sexier ) but difference is to create a script a là Bigal takes a couple of minutes while mine takes a couple of hours to create so you'd only take this road if speed is key & if you think you can put it to good use in the near future (and don't mind loosing thumbnail when using odbx) Quote
BIGAL Posted November 6, 2021 Posted November 6, 2021 If you modify what I have posted then use accoreconsole it will scream through the dwg's. You can make the lisp the script if you want or make the script with (load "Erasetext.lsp") (setq ent (entget (car (entsel "\nPick text ")))) (setq pt (cdr (assoc 10 ent))) replace with (setq pt (list x y)) ; put in the co-ordinates https://through-the-interface.typepad.com/through_the_interface/2012/02/the-autocad-2013-core-console.html Quote
B2P Posted November 9, 2021 Author Posted November 9, 2021 Hello again. Taking advantage of the theme, how can I make the routines also work if the text to be removed is in the model space? Once again, thank you very much in advance Quote
rlx Posted November 9, 2021 Posted November 9, 2021 as far as I know my version does all tabs , including modelspace Quote
rlx Posted November 9, 2021 Posted November 9, 2021 (edited) Bigal's version uses if statement On 11/5/2021 at 12:12 AM, BIGAL said: (vlax-for lay tabs (setq tabname (vla-get-name lay)) (if (/= tabname "Model") (progn (setvar "ctab" tabname) (command "Pspace") (command "zoom" "e") (command "erase" pt "") ) ) ) just remove the condition (vlax-for lay tabs (setvar "ctab" (vla-get-name lay))(command "zoom" "e") (command "erase" pt "") ) Edited November 9, 2021 by rlx Quote
B2P Posted November 10, 2021 Author Posted November 10, 2021 (edited) tanks rlx. But I can't make your routine work, I create a folder with the name XX and inside I have 3 files with the text in the model space in the same location in all the files that I want to delete, I run the lisp, I select the text and in the source folder I write XX , but I get the message: Source folder empty or invalid: XX if you could help me with this problem please Edited November 10, 2021 by B2P Quote
rlx Posted November 10, 2021 Posted November 10, 2021 strange... I have no problems (besides trying to upload an animated gif to this site to show I have no problems , maybe size is too big) , awel , if Bigal's version works for you then there is no problem 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.