find and replace without 3rd party..
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
find and replace without 3rd party..

 
Post new topic   Reply to topic    CADForums.net Forum Index -> Customization
Author Message
Jon Baker
Guest





Posted: Fri Jan 07, 2005 8:54 am    Post subject: find and replace without 3rd party.. Reply with quote

I tried a search, didn't really see much that could help me.

I have a few hundred foundation plans that I need to go thru and change the plan number from something like; PLAN 1024, and change it to PLAN NI11. every 5-10 plans are a different number so I would need to change that.. how ever in replacing the text.. I would also need to "SAVEAS" the new plan number.. but our plans are named. 1024-R2-AB.dwg and such.. need to be renamed NI11-R2-AB.dwg..


any ideas.. I'm lost.. and screwed.. I don't want to have to do this by hand..


ACAD 2k5 w/LDD

Jon Baker
Carroll & Lange, Inc.
Professional Land Surveyors and Engineers.
Lakewood, Colorado
www.carroll-lange.com

Back to top
jochen
Guest





Posted: Fri Jan 07, 2005 1:12 pm    Post subject: Re: find and replace without 3rd party.. Reply with quote

Try out ScriptPro- it is included in the AutoCAD package.
If there are problems - so I think, I can help you
Regards
Jochen
www.black-cad.de

"Jon Baker" <jonathanjbaker@SPhotmailAM.com> schrieb im Newsbeitrag news:41de0817$1_2@newsprd01...
I tried a search, didn't really see much that could help me.

I have a few hundred foundation plans that I need to go thru and change the plan number from something like; PLAN 1024, and change it to PLAN NI11. every 5-10 plans are a different number so I would need to change that.. how ever in replacing the text.. I would also need to "SAVEAS" the new plan number.. but our plans are named. 1024-R2-AB.dwg and such.. need to be renamed NI11-R2-AB.dwg..


any ideas.. I'm lost.. and screwed.. I don't want to have to do this by hand..


ACAD 2k5 w/LDD

Jon Baker
Carroll & Lange, Inc.
Professional Land Surveyors and Engineers.
Lakewood, Colorado
www.carroll-lange.com
Back to top
Jon Baker
Guest





Posted: Fri Jan 07, 2005 5:56 pm    Post subject: Re: find and replace without 3rd party.. Reply with quote

well I just had that installed on my machine yesterday.

I need to combine scripts and lisp to do this I know..
a lisp that will rename the file according to the folder the drawings are in.
a routine that will find and replace, replacing with the name of the folder.
plus other lil stuff that I already have..
"jochen" <scj.schulz@t-online.de> wrote in message news:41de448f_3@newsprd01...
Try out ScriptPro- it is included in the AutoCAD package.
If there are problems - so I think, I can help you
Regards
Jochen
www.black-cad.de

"Jon Baker" <jonathanjbaker@SPhotmailAM.com> schrieb im Newsbeitrag news:41de0817$1_2@newsprd01...
I tried a search, didn't really see much that could help me.

I have a few hundred foundation plans that I need to go thru and change the plan number from something like; PLAN 1024, and change it to PLAN NI11. every 5-10 plans are a different number so I would need to change that.. how ever in replacing the text.. I would also need to "SAVEAS" the new plan number.. but our plans are named. 1024-R2-AB.dwg and such.. need to be renamed NI11-R2-AB.dwg..


any ideas.. I'm lost.. and screwed.. I don't want to have to do this by hand..


ACAD 2k5 w/LDD

Jon Baker
Carroll & Lange, Inc.
Professional Land Surveyors and Engineers.
Lakewood, Colorado
www.carroll-lange.com

Back to top
Doug
Guest





Posted: Fri Jan 07, 2005 6:19 pm    Post subject: Re: find and replace without 3rd party.. Reply with quote

That sounds like a pretty simple script job, in combination with a DOS batch file or Win2K CMD file.

The BAT/CMD file goes like this:

FOR %%G in (*.DWG) DO "C:\Program Files\AutoCAD 2004\acad.exe" %%G /b c:\YOURSCRIPT.scr


My script to replace an attribute named DESIGN in a title block named DSIZE1 (or CSIZE2, hence the wildcards) with the words "Released to Preliminary" goes like this:

-attedit;y;?SIZE*;DES*;*;CROSSING;$M=$(eval,$(getvar,extmin)";"$(getvar,extmax));;v;r;RELEASED TO PRELIMINARY;;

It uses a crossing window that covers the complete drawing extents to find the named attribute and then replaces the existing value with the new one.
But in your case you'd add SAVEAS to the script. Or, better yet, just leave the drawing file name, and use ZDNet's free multiple file rename utility MULTIREN to rename the files before or after you run the script. That MULTIREN saves me a LOT of work!

Doug

"Jon Baker" <jonathanjbaker@SPhotmailA
M.com> wrote in message news:41de0817$1_2@newsprd01...
I tried a search, didn't really see much that could help me.

I have a few hundred foundation plans that I need to go thru and change the plan number from something like; PLAN 1024, and change it to PLAN NI11. every 5-10 plans are a different number so I would need to change that.. how ever in replacing the text.. I would also need to "SAVEAS" the new plan number.. but our plans are named. 1024-R2-AB.dwg and such.. need to be renamed NI11-R2-AB.dwg..


any ideas.. I'm lost.. and screwed.. I don't want to have to do this by hand..


ACAD 2k5 w/LDD

Jon Baker
Carroll & Lange, Inc.
Professional Land Surveyors and Engineers.
Lakewood, Colorado
www.carroll-lange.com
Back to top
jonbaker
Guest





Posted: Sat Jan 08, 2005 12:07 am    Post subject: Re: find and replace without 3rd party.. Reply with quote

i'll try that thanx..
Back to top
jonbaker
Guest





Posted: Sat Jan 08, 2005 12:42 am    Post subject: Re: find and replace without 3rd party.. Reply with quote

okay i have the saveas down.. now i only need to get the text to replace.

-attedit does not work on single line text.
i cannot get another 3rd party application.
i need to get this done.

here is what i am using for the saveas
(defun c:SVA ()
(setq
PATH (getvar "dwgprefix")
FLDR (substr PATH 35 4)
DWG (GETVAR "DWGNAME")
DWGN (SUBSTR DWG 5)
FILE (STRCAT PATH FLDR "-" dwgn)
)
(COMMAND "SAVEAS" "" FILE)
)


thank you very much.
Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> Customization All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Powered by phpBB