Alexv Posted February 9, 2022 Posted February 9, 2022 (edited) Hi everyone, I hope y'all are having a good New year so far. I've been wondering if it's possible to generate a report that reports all the texts in the drawing (inside the model space, not the layout space). For example, for a bench icon, I would have a text 'Bench' next to it, or a text description 'RF' next to the roof line, or UP or DN text next to a staircase to show it's elevation direction (going up or down). Is it possible for Autocad/Civil 3d to report all the text being used in the drawing (as a .txt file or something similar) so that I can copy those texts and use them in a legend table. Often times, I would have a few dozen texts and descriptions in a drawing and I would have to manually scan through the drawing (with my eyes) to find all the 'abbreviated text' to put them in the Legend table. It would be good if Autocad/Civil 3d can generate a text report (of all the text in a drawing) that sort the text from shortest to longest. So the abbreviated text (2 to 3 letters) can easily be identified. I have read through the Autocad documentation but I couldn't find anything similar to what i'm after. Any ideas?? Thanks y'all and have a good day. Edited February 9, 2022 by Alexv Quote
SLW210 Posted February 9, 2022 Posted February 9, 2022 DATAEXTRACTION will do that. Should be several LISP around if you prefer that method. 1 Quote
BIGAL Posted February 9, 2022 Posted February 9, 2022 You mention CIV3D so is the text a COGO label ? That is different object to text. 1 Quote
Alexv Posted February 10, 2022 Author Posted February 10, 2022 (edited) @SLW210 Thanks for the reply SLW, whatever works, could you please link me to the post with said 'lisp' script for the data extraction? @BIGALHi Bigal, as always, thanks for the reply. The texts are just the standard Autocad text. Edited February 10, 2022 by Alexv Quote
maratovich Posted February 10, 2022 Posted February 10, 2022 Maybe this will work for you - AutoReplaceCAD Although a text replacement program, but it can get the desired texts and save. You need to select the "Text Translation" tab, get all the texts and save to Excel. Quote
BIGAL Posted February 11, 2022 Posted February 11, 2022 Using ssget with text filter can get all text, then sort, then check string length. NOTE text only at this stage not mtext. ; look for short text and replace ; BY AlanH Feb 2022 ; By Gile (defun remove_doubles (lst) (if lst (cons (car lst) (remove_doubles (vl-remove (car lst) lst))) ) ) (defun AH:replacetext (oldtext anstxt / k ent2 extxt num) (repeat (setq k (sslength ss)) (setq ent2 (vlax-ename->vla-object (ssname ss (setq k (- k 1))))) (setq extxt (vla-get-textstring ent2)) (if (= extxt oldtext) (vla-put-textstring ent2 anstxt) ) ) ) (defun c:shrtxt ( / lst ss ent lst2 ans) (if (not AH:getvalsm)(load "Multi Getvals.lsp")) (setq num (atoi (car (AH:getvalsm (list "Num Characters" "less than " 5 4 "3"))))) (setq ss (ssget "X" '((0 . "TEXT")))) (setq lst '()) (repeat (setq x (sslength ss)) (setq ent (entget (ssname ss (setq x (1- x))))) (setq lst (cons (cdr (assoc 1 ent)) lst)) ) (setq lst2 (remove_doubles lst)) (setq lst2 (vl-sort lst2 '<)) (foreach txt lst2 (if (< (strlen txt) num) (progn (setq ans (car (AH:getvalsm (list "Replace text" "New text" 20 19 txt)))) (AH:replacetext txt ans) ) ) ) (princ) ) (c:shrtxt) 1 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.