CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor and other Autodesk products []
Cesky English Deutsch
 Visitors: 3909 
RSS - files RSS channel - CAD files

Download Download of CAD utilities

This site gets about 500.000 unique visits monthly. Autodesk 2016 products (builds). Tips for AutoCAD 2016, Revit 2016 and Inventor 2016.


srxTEXT - search and replace AutoCAD drawing texts using regular expressions, supports batch scripts, table replacements, numeric intervals (trial): [ + show all files ]

Free applications and CAD utilities (mostly our freeware)
CAD Utilities
Download srxTEXT - search and replace AutoCAD drawing texts using regular expressions, supports batch scripts, table replacements, numeric intervals (trial)
SRXTEXT - search/replace with regular expressions

(C)2011, CAD Studio a.s. - see srxtext.txt

SRXTEXT is a LISP utility for AutoCAD 2000/i, 2002, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 which can search and/or replace drawing texts (TEXT, MTEXT, DIMTEXT, ATTRIB, ATTDEF).
You can choose from exact string match, substring
match/replace or regular expressions. For the
regular expression functionality, AutoCAD Express
Tools are required.
You can search (and replace) the whole drawing,
any specified layer or selected objects.
SRXTEXT zooms to any matching text and offers to
Replace, Autoreplace (Don't ask), Skip to next or
Exit the search/replace loop.

SRXTEXT contains two commands - SRXTEXT and SRXTEXTCSV.
The "CSV" version loads the search-replace string pairs
from a .CSV text file so you can predefine complex
replacements e.g. in Excel. The .CSV file is in format:
(sample file included)

The CSV version is a trial version - only the first 2 pairs are processed.

Regular expressions:
Using regular expressions you can perform complex
replacements like changing:
Part:457/03667 Code:D19
For this case you would use the search and replace
Part:\2/\3 Code:\1

Or you can append strings to the beginning of your
or to the end of your texts:

Or you can replace just the first occurrence of
a substring in text:
search: \(.\)oldtext\(.\)
replace: \1newtext\2

Another example of complex replacements:
KWD-5-3, KW-4-2, KWP-1-5
KCD-5-1, KC-4-1, KCP-1-1
search: \(.\)W\(.*\)\-\(.\)\-\(.\)
replace: \1C\2-\3-1

Cutting the number of decimal places to 1:
search: \([0-9]*\)\.\([0-9]\)[0-9]*
replace: \1.\2

Adding a thousands separator (",") to numbers.
search: -?\([0-9]+\)\([0-9][0-9][0-9]\)
replace: \1,\2
(repeat it for milion/bilion/... triplets)

Delete all text after the first period in text:
search: ^\([^\.]*\)\..*
replace: \1.

Replace trailing "A"s with "B"s:

Use replacement in scripts:
You can use ScriptPro or other script processor to
perform batch replacements on multiple DWG files.
The script could look like e.g.:

(load "srxtext.vlx")

- or just - 

(load "srxtext.vlx")
(srxtext "Substring" "oldtext" "newtext" "All")

Tip 1:
MTEXT objects can contain hidden control character
codes, so they may appear to not meet the exact
matches (btw, you can use SRXTEXT to remove these
control characters)

Tip 2:
You can use srxText to add, modify or delete control
characters in MText texts - changing the string height,
color, font, width, etc. E.g. {\T2.0;XXX}

Tip 3:
set _SRXTEXTNOZOOM to T (true) to disable running zooms:

Tip 4:
SRXTEXTCSV honors the FILEDIA setting so you can enter
the .CSV file name on the commandline (e.g. in batch
scripts) with FILEDIA=0

You cannot replace strings in text generated by Fields.
Character case must match exactly.

SRXTEXT contains also a LISP interface so you can
use the srxText functionality in our LISP routines:
(srxTEXT "< mode>" "< search>" "< replace>" "< layers>")
< mode> can be Substring or Regular or Exact (case sensitive)
< search> is the searched string
< replace> is the replacement string
< layers> can be "All", or a name of an existing layer,
or "Select" to select objects interactively, or a
selection set variable with selected objects
returned value is the number of replacements done
(srxTEXT "Substring" "Ford T1" "Ford Galaxy" "All")
(srxTEXT "Exact" "Autocad" "AutoCAD" myselectionset)

License: SRXTEXT is a free/trial utility by CAD Studio, do not publish it online on other than CADstudio's web servers, do not sell, lend or exchange it.

23kB 27.1.2015
Description Koupit
Buy online
The file is a compressed ZIP archive. You can unpack it using your Windows Explorer, or WinZIP, or similar application. Then follow the contents of the ZIP package.

Many other files also on CAD Studio Helpdesk, CAD blocks in the Block catalog.