Jump to content

Delete text in same position of multples drawings


B2P

Recommended Posts

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.

Link to comment
Share on other sites

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.

  • Agree 1
Link to comment
Share on other sites

Hi everyone,

Thank you very much for the advice, graphically what I need can be better explained with the help of the following image:

 

EXAMPLE.jpg

 

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.

 

Link to comment
Share on other sites

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 by BIGAL
Link to comment
Share on other sites

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)

 

🐉

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 by rlx
Link to comment
Share on other sites

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 by B2P
Link to comment
Share on other sites

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 🙂

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...