CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor and other Autodesk products [www.cadforum.cz]
Cesky English Deutsch
Login/Register:
 Visitors: 1701 
RSS - files RSS channel - CAD files

Download Download of CAD utilities

CAD formats. New AutoCAD 2015 commands and variables. CAD block library with >10.000 blocks. Tips for AutoCAD 2015, Revit 2015 and Inventor 2015.

Download


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


DownloadFileSizeDateInfoBuy
 
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. http://www.cadstudio.cz - see srxtext.txt

SRXTEXT is a LISP utility for AutoCAD 2000/i, 2002, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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:
"whattofind1","whattoreplace1"
"whattofind2","whattoreplace2"
(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:
D19-457-03667
to
Part:457/03667 Code:D19
For this case you would use the search and replace
strings:
\([A-Z][0-9][0-9]\)\-\(...\)\-\(.*\)
Part:\2/\3 Code:\1

Or you can append strings to the beginning of your
texts:
^\(.\)
newprefix\1
or to the end of your texts:
\(.\)$
\1newsuffix

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
to
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:
\(.\)A$
\1B


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")
srxtext
s
oldtext
newtext
all
all
d

- 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:
(setq _SRXTEXTNOZOOM T) 

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
Examples:
(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 5.4.2011
V1.52
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 BBS, CAD blocks in the Block catalog.

To share your documents on the Web - see iPROJECT.