Need to search and replace drive letters in 12,000 drawings.

Need to search and replace drive letters in 12,000 drawings.

Anonymous
Not applicable
766 Views
22 Replies
Message 1 of 23

Need to search and replace drive letters in 12,000 drawings.

Anonymous
Not applicable
We are changing the way our projects are arranged on our file server.
Before we had drives Q: U: V: W: U: X: Now we want to get arid of
all those drive letters and replace them with P: for projects. The problem
is that we have about 12,000 dwg files on our server. We need a way
to search and see if any drawings reference Q: for example. If there
is no reference to the Q: drive then we can remove the Q: drive from
the login scripts.
0 Likes
767 Views
22 Replies
Replies (22)
Message 2 of 23

Anonymous
Not applicable
Are you using Xrefs?

Dave Lewis wrote:

> We are changing the way our projects are arranged on our file server.
> Before we had drives Q: U: V: W: U: X: Now we want to get arid of
> all those drive letters and replace them with P: for projects. The problem
> is that we have about 12,000 dwg files on our server. We need a way
> to search and see if any drawings reference Q: for example. If there
> is no reference to the Q: drive then we can remove the Q: drive from
> the login scripts.
0 Likes
Message 3 of 23

Anonymous
Not applicable
A long time ago, in a galaxy far away, I used to be able to do a GREP on the
files and get directory information.... Maybe that still works......

Nick

"Yves Allaire" wrote in message
news:[email protected]...
> Are you using Xrefs?
>
> Dave Lewis wrote:
>
> > We are changing the way our projects are arranged on our file server.
> > Before we had drives Q: U: V: W: U: X: Now we want to get arid of
> > all those drive letters and replace them with P: for projects. The
problem
> > is that we have about 12,000 dwg files on our server. We need a way
> > to search and see if any drawings reference Q: for example. If there
> > is no reference to the Q: drive then we can remove the Q: drive from
> > the login scripts.
>
0 Likes
Message 4 of 23

Anonymous
Not applicable
bingo. Xrefs are NOT in the same directories

Yves Allaire
|>Are you using Xrefs?
0 Likes
Message 5 of 23

Anonymous
Not applicable
what's a GREP and does it work with R14 files?

"Nick Jacobs"
|>A long time ago, in a galaxy far away, I used to be able to do a GREP on the
|>files and get directory information.... Maybe that still works......
0 Likes
Message 6 of 23

Anonymous
Not applicable
I don't know how complex are your files but there is a solution with the
system variable PROJECTNAME, to which you can assign search paths (under
Tools Preferences), as much as you want, it don't seem to look to sub
folders though.

Hope this helps

Dave Lewis wrote:

> bingo. Xrefs are NOT in the same directories
>
> Yves Allaire
> |>Are you using Xrefs?
0 Likes
Message 7 of 23

Anonymous
Not applicable
In article <[email protected]>, Dave Lewis
wrote:
> what's a GREP

Generalized Regular Ecpression Parser. Originally developed for UNIX
but ported to all OS's in many incarnations. Looks for text patterns
in files. Kind of like Start|Find| Files or Folders on steroids.

> and does it work with R14 files

I believe not. I think the text in R14 files is compressed.

jrf
Member of the Autodesk Discussion Forum Moderator Program
0 Likes
Message 8 of 23

Anonymous
Not applicable
I don't believe there's any kind of text compression in
any AutoCAD file versions. Let's of people use Explorer's
Find to locate drawings that contain things like block
names, and arbitrary text strings.

Jon Fleming wrote:
>
> In article <[email protected]>, Dave Lewis
> wrote:
> > what's a GREP
>
> Generalized Regular Ecpression Parser. Originally developed for UNIX
> but ported to all OS's in many incarnations. Looks for text patterns
> in files. Kind of like Start|Find| Files or Folders on steroids.
>
> > and does it work with R14 files
>
> I believe not. I think the text in R14 files is compressed.
>
> jrf
> Member of the Autodesk Discussion Forum Moderator Program

--
/*********************************************************/
/* Tony Tanzillo Design Automation Consulting */
/* Programming & Customization for AutoCAD & Compatibles */
/* ----------------------------------------------------- */
/* [email protected] */
/* http://ourworld.compuserve.com/homepages/tonyt */
/*********************************************************/
0 Likes
Message 9 of 23

Anonymous
Not applicable
Jon Fleming wrote:

> In article <[email protected]>, Dave Lewis
> wrote:
> > what's a GREP
> Generalized Regular Ecpression Parser.

Many people think this. Actually, the name comes from the 'ed' (early
Unix editor, ancestor of 'vi') command:
g//p
which is interpreted as:

* g
Global prefix
* //
Search for Regular Expression
* p
Print selected line(s)

Another drop in the sea of arcane knowledge. 🙂

> > and does it work with R14 files
> I believe not. I think the text in R14 files is compressed.

Various types of text objects are compressed in R14 and A2K DWG files,
but many textual items (block names, table names, etc.) are not.
--
Frank Whaley
Autodesk, Inc.
[email protected]
http://www.autodesk.com/expresstools
Express Tools - Your wish is our (command ...)
0 Likes
Message 10 of 23

Anonymous
Not applicable
There are over 100 active projects and each project has anyware from 2 to 10 different
tasks. So the possibilities are between 200 to 1000 different base drawings subdirectories.
Come dood

Yves Allaire
|>I don't know how complex are your files but there is a solution with the
|>system variable PROJECTNAME, to which you can assign search paths (under
|>Tools Preferences), as much as you want, it don't seem to look to sub
|>folders though.
0 Likes
Message 11 of 23

Anonymous
Not applicable
Then you only hopes are :

1- Replace the strings inside the drawings with GREP, it works because you can search (and find)
the text inside a drawing. I can't give you a software name to do this though.
2- Open each drawing as needed and reattach the XREFs
3- Keep it the way it is.

I was able to find the following string inside one of my drawings.
"q:\224gd\dessin\rep_utm_mine.dwg" which is a XREF.

Hope this helps.

Dave Lewis wrote:

> There are over 100 active projects and each project has anyware from 2 to 10 different
> tasks. So the possibilities are between 200 to 1000 different base drawings subdirectories.
> Come dood
>
> Yves Allaire
> |>I don't know how complex are your files but there is a solution with the
> |>system variable PROJECTNAME, to which you can assign search paths (under
> |>Tools Preferences), as much as you want, it don't seem to look to sub
> |>folders though.
0 Likes
Message 12 of 23

Anonymous
Not applicable
Yves Allaire wrote:
>
> Then you only hopes are :
>
> 1- Replace the strings inside the drawings with GREP, it works because you can search (and find)
> the text inside a drawing. I can't give you a software name to do this though.

Dwg files are not text files. You will probably corrupt the drawing
unless the old and new strings are the same length 🙂

> 2- Open each drawing as needed and reattach the XREFs
> 3- Keep it the way it is.
>
> I was able to find the following string inside one of my drawings.
> "q:\224gd\dessin\rep_utm_mine.dwg" which is a XREF.
>
> Hope this helps.
>
> Dave Lewis wrote:
>
> > There are over 100 active projects and each project has anyware from 2 to 10 different
> > tasks. So the possibilities are between 200 to 1000 different base drawings subdirectories.
> > Come dood
> >
> > Yves Allaire
> > |>I don't know how complex are your files but there is a solution with the
> > |>system variable PROJECTNAME, to which you can assign search paths (under
> > |>Tools Preferences), as much as you want, it don't seem to look to sub
> > |>folders though.

--
|
----+----------------------------------------------
| Byron Blattel
| CADwerx---Applications for AutoCAD
|
| e-mail: [email protected]
|
|
0 Likes
Message 13 of 23

Anonymous
Not applicable
Yves Allaire
|>Then you only hopes are :
|>
|>1- Replace the strings inside the drawings with GREP, it works because you can search (and find)
|>the text inside a drawing. I can't give you a software name to do this though.

Well is the GREP method like using a HEX editor or is it clear text? It sounds like it might work.
All I have to do is change drive letters.

|>2- Open each drawing as needed and reattach the XREFs

way way too many drawings for that

|>3- Keep it the way it is.
|>
|>I was able to find the following string inside one of my drawings.
|>"q:\224gd\dessin\rep_utm_mine.dwg" which is a XREF.
0 Likes
Message 14 of 23

Anonymous
Not applicable
I believe AutoCAD DWG files have a checksum ... don't change anything in the DWG file unless you
are prepared to recalculate the checksum.

jrf
Member of the Autodesk Discussion Forum Moderator Program

In article <[email protected]>, Yves Allaire wrote:
> 1- Replace the strings inside the drawings with GREP, it works because you can search (and find)
> the text inside a drawing. I can't give you a software name to do this though.
0 Likes
Message 15 of 23

Anonymous
Not applicable
It's not possible. R14 AutoCAD drawings use compression and it's not
possible to find any attribute or xref text strings in DWG file, the way it
could be done in R12.

--
Alex Januszkiewicz
Intelcad Systems and 911 DWG Recovery Services
http://www.intelcad.com
*Check out our DWF => DWG converter*
**The FASTEST Xref Re-path program on the planet**
* ObjectARX, OpenDWG, WhipTK, MDL *
--

Tony Tanzillo wrote in message
news:[email protected]...
> I don't believe there's any kind of text compression in
> any AutoCAD file versions. Let's of people use Explorer's
> Find to locate drawings that contain things like block
> names, and arbitrary text strings.
>
> Jon Fleming wrote:
> >
> > In article <[email protected]>, Dave Lewis
> > wrote:
> > > what's a GREP
> >
> > Generalized Regular Ecpression Parser. Originally developed for UNIX
> > but ported to all OS's in many incarnations. Looks for text patterns
> > in files. Kind of like Start|Find| Files or Folders on steroids.
> >
> > > and does it work with R14 files
> >
> > I believe not. I think the text in R14 files is compressed.
> >
> > jrf
> > Member of the Autodesk Discussion Forum Moderator Program
>
> --
> /*********************************************************/
> /* Tony Tanzillo Design Automation Consulting */
> /* Programming & Customization for AutoCAD & Compatibles */
> /* ----------------------------------------------------- */
> /* [email protected] */
> /* http://ourworld.compuserve.com/homepages/tonyt */
> /*********************************************************/
0 Likes
Message 16 of 23

Anonymous
Not applicable
If you found such a string in your drawing, it must have been R12 DWG. Since
R13, DWGs are compressed and byte boundaries don't mean anything anymore,
the DWG is a compressed bit coded stream, so grep idea is absolutely
useless. Switching single bit in a bit coded stream will most likely corrupt
the whole DWG file.

I bet anybody on this newsgroup for $50 bottle of red, that it's impossible
to find xrefs in R14 DWG via grep, it's just pure nonsense.

BTW: my XREF RE-PATHING program that works without AutoCAD, will change path
in DWGs with the speed of 1000 dwgs/hour. You can download free trial
version from my web site.

--
Alex Januszkiewicz
Intelcad Systems and 911 DWG Recovery Services
http://www.intelcad.com
*Check out our DWF => DWG converter*
**The FASTEST Xref Re-path program on the planet**
* ObjectARX, OpenDWG, WhipTK, MDL *
--

Yves Allaire wrote in message
news:[email protected]...
> Then you only hopes are :
>
> 1- Replace the strings inside the drawings with GREP, it works because you
can search (and find)
> the text inside a drawing. I can't give you a software name to do this
though.
> 2- Open each drawing as needed and reattach the XREFs
> 3- Keep it the way it is.
>
> I was able to find the following string inside one of my drawings.
> "q:\224gd\dessin\rep_utm_mine.dwg" which is a XREF.
>
> Hope this helps.
>
> Dave Lewis wrote:
>
> > There are over 100 active projects and each project has anyware from 2
to 10 different
> > tasks. So the possibilities are between 200 to 1000 different base
drawings subdirectories.
> > Come dood
> >
> > Yves Allaire
> > |>I don't know how complex are your files but there is a solution with
the
> > |>system variable PROJECTNAME, to which you can assign search paths
(under
> > |>Tools Preferences), as much as you want, it don't seem to look to sub
> > |>folders though.
>
0 Likes
Message 17 of 23

Anonymous
Not applicable
1. You are right, changing anything in bit coded stream (that's what R13 and
up DWGs are) is guaranteed to corrupt the drawing.
2. He will not find single string to change, bit coded stream ignores byte
boundaries, so even if text was not compressed, it would be impossible to
recognize it.
3. Funny thread (and VERY dangerous idea)
4. xRepath - Win9x/NT standalone utility, will do this Herculean job, free
download, check http://www.intelcad.com

--
Alex Januszkiewicz
Intelcad Systems and 911 DWG Recovery Services
http://www.intelcad.com
*Check out our DWF => DWG converter*
**The FASTEST Xref Re-path program on the planet**
* ObjectARX, OpenDWG, WhipTK, MDL *
--

Byron Blattel wrote in message
news:[email protected]...
> Dwg files are not text files. You will probably corrupt the drawing
> unless the old and new strings are the same length 🙂
>
> > 2- Open each drawing as needed and reattach the XREFs
> > 3- Keep it the way it is.
> >
> > I was able to find the following string inside one of my drawings.
> > "q:\224gd\dessin\rep_utm_mine.dwg" which is a XREF.
> >
> > Hope this helps.
> >
> > Dave Lewis wrote:
> >
> > > There are over 100 active projects and each project has anyware from 2
to 10 different
> > > tasks. So the possibilities are between 200 to 1000 different base
drawings subdirectories.
> > > Come dood
> > >
> > > Yves Allaire
> > > |>I don't know how complex are your files but there is a solution with
the
> > > |>system variable PROJECTNAME, to which you can assign search paths
(under
> > > |>Tools Preferences), as much as you want, it don't seem to look to
sub
> > > |>folders though.
>
> --
> |
> ----+----------------------------------------------
> | Byron Blattel
> | CADwerx---Applications for AutoCAD
> |
> | e-mail: [email protected]
> |
> |
0 Likes
Message 18 of 23

Anonymous
Not applicable
Alex Januszkiewicz wrote:
>
> If you found such a string in your drawing, it must have been R12 DWG. Since
> R13, DWGs are compressed and byte boundaries don't mean anything anymore,
> the DWG is a compressed bit coded stream, so grep idea is absolutely
> useless. Switching single bit in a bit coded stream will most likely corrupt
> the whole DWG file.
>
> I bet anybody on this newsgroup for $50 bottle of red, that it's impossible
> to find xrefs in R14 DWG via grep, it's just pure nonsense.

They can most certainly be found (R14 & A2K) if you know before hand
what you are looking for. They are archived with the length of the
string preceding the string itself. They can be edited as long as the
length of the string is not changed, although I would not recommend it
to users.

--
|
----+----------------------------------------------
| Byron Blattel
| CADwerx---Applications for AutoCAD
|
| e-mail: [email protected]
|
|
0 Likes
Message 19 of 23

Anonymous
Not applicable
Alex Januszkiewicz wrote:

> I bet anybody on this newsgroup for $50 bottle of red, that it's impossible
> to find xrefs in R14 DWG via grep, it's just pure nonsense.

Copied from a command window:

C:\ACADR14\SAMPLE>strings *.dwg | grep dwg
bftitle.dwgA
bflylogo.dwgA
bflylogo.dwgA

C:\ACADR14\SAMPLE>dwgver b*.dwg
[bflyhse.dwg] Internal development: Early R14
[bflylogo.dwg] Internal development: Early R14
[bftitle.dwg] Internal development: Early R14
--
Frank Whaley
Autodesk, Inc.
[email protected]
http://www.autodesk.com/expresstools
Express Tools - Your wish is our (command ...)
0 Likes
Message 20 of 23

Anonymous
Not applicable
Byron,

You're right (but Tony T. was first to point that out, so he gets the
bottle). Big surprise for me, as this is very inconsistent with the rest of
R14 DWG being bit coded. Shouldn't have been so jumpy 🙂

Each record (now, after what happened, I'm a bit afraid to say "each", let's
say most records) in DWG have CRC field, that is there for the purpose of
checking, if some bit has not been accidentally changed in the record.
Modifying letter C: to M: would be then considered by AutoCAD an accident,
as whoever does it with hex editor will not modify CRC field accordingly.
Don't know though, if CRC is generated for the record containing path
string. I would just advise extreme caution and lot's of experimenting,
before somebody will decide to run all drawings through some hex editing.

--
Alex Januszkiewicz
Intelcad Systems and 911 DWG Recovery Services
http://www.intelcad.com
*Check out our DWF => DWG converter*
**The FASTEST Xref Re-path program on the planet**
* ObjectARX, OpenDWG, WhipTK, MDL *
--

Byron Blattel wrote in message
news:[email protected]...
>
>
> Alex Januszkiewicz wrote:
> >
> > If you found such a string in your drawing, it must have been R12 DWG.
Since
> > R13, DWGs are compressed and byte boundaries don't mean anything
anymore,
> > the DWG is a compressed bit coded stream, so grep idea is absolutely
> > useless. Switching single bit in a bit coded stream will most likely
corrupt
> > the whole DWG file.
> >
> > I bet anybody on this newsgroup for $50 bottle of red, that it's
impossible
> > to find xrefs in R14 DWG via grep, it's just pure nonsense.
>
> They can most certainly be found (R14 & A2K) if you know before hand
> what you are looking for. They are archived with the length of the
> string preceding the string itself. They can be edited as long as the
> length of the string is not changed, although I would not recommend it
> to users.
>
> --
> |
> ----+----------------------------------------------
> | Byron Blattel
> | CADwerx---Applications for AutoCAD
> |
> | e-mail: [email protected]
> |
> |
0 Likes