Jord_91 Posted February 21, 2018 Share Posted February 21, 2018 Hi, I have about 1500 drawing in witch i woul like to run a command based on the name of the file ex: () So in Every files startinf with 3-ML2030 I would run the "2030PSQ" command and then save as adding PSQ as suffix for the file name. And i Would do the same thing again but this time with "2030OVA" command adding OVA suffix. I would need to be able to recreate this path with the 2030, 2036, 2042, 2430, 2436, 2442 drawing sorth it would be finding wath command to run depend of the name of the file. Am i clear Thanks!!! Quote Link to comment Share on other sites More sharing options...
Jord_91 Posted February 21, 2018 Author Share Posted February 21, 2018 here's the second image Quote Link to comment Share on other sites More sharing options...
BIGAL Posted February 22, 2018 Share Posted February 22, 2018 Do it sort of outside Autocad but inside you can rename a file without opening and saving it. Or do you want two copies new and old ? Quote Link to comment Share on other sites More sharing options...
Jord_91 Posted February 22, 2018 Author Share Posted February 22, 2018 Do it sort of outside Autocad but inside you can rename a file without opening and saving it. Or do you want two copies new and old ? As you said, I copy then rename files with powershell... Now I have created a Script that i would like to run on specific files with the same base. I mean, I'm having something like 3-ml203029arvova.dwg, 3-ml203036arvova.dwg, 3-ml203042arvova.dwg, 3-ml203629arvova.dwg, 3-ml203636arvova.dwg, 3-ml203642arvova.dwg and i have some scipt called 2030ova, 2036ova. Here'S my script command _-view _Left _ai_selall section _crossing 0,0 23-1/8,84 0,4-1/2 23-3/8,4-1/2 26,8 effacer _crossing 0,0 23-1/8,4 _-view _top -INSERER "C:/Users/jlarrivee/Desktop/pattes/2030OVA.dwg" 0,0,0 1 1 0 ANNULER fin decompos _last SAUVERAP Help me please!! Quote Link to comment Share on other sites More sharing options...
Jord_91 Posted February 22, 2018 Author Share Posted February 22, 2018 The only thing is that my script works when i'm swipping it in my open drawing but won't work with Script pro... My sorcelery is not strong enough yet! Quote Link to comment Share on other sites More sharing options...
BIGAL Posted February 23, 2018 Share Posted February 23, 2018 I copy then rename files If you open a dwg then saveas will make a copy and rename. Can do as last line after your script. Quote Link to comment Share on other sites More sharing options...
rlx Posted February 23, 2018 Share Posted February 23, 2018 The only thing is that my script works when i'm swipping it in my open drawing but won't work with Script pro... My sorcelery is not strong enough yet! maybe Script Pro has some issues with a foreign language? Can't use Script Pro here at my work because it's blocked (one of many programs) https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/what-does-the-dot-mean/td-p/805031 Quote Link to comment Share on other sites More sharing options...
BIGAL Posted February 23, 2018 Share Posted February 23, 2018 rlx look into MS Word I make a lot of my scripts there. You can search replace ^p which is the end of paragraph so a list of dwg names becomes replace ^P with ^pOpen same with stuff on the end ^p close^p and so forth. Same with using excel can do lots of smart column joins using Concatenate, then copy column to notepad and save as .SCR Quote Link to comment Share on other sites More sharing options...
rlx Posted February 23, 2018 Share Posted February 23, 2018 rlx look into MS Word I make a lot of my scripts there. You can search replace ^p which is the end of paragraph so a list of dwg names becomes replace ^P with ^pOpen same with stuff on the end ^p close^p and so forth. Same with using excel can do lots of smart column joins using Concatenate, then copy column to notepad and save as .SCR Must admit I'm not very experienced with MS Word but your suggestions look worth investigation bigal , thanx. My colleagues here use it a lot more because they have to write their scope of work with it , and I'm just a simple AutoCAD designer. They also used script pro until it was blocked by IT so I wrote my own. Maybe not as fast but fast enough for me. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted February 23, 2018 Share Posted February 23, 2018 Rlx Word and maybe Notepad++ may support special character replacement ^t is a tab. I grew up on DOS so did lots of others here. try this bottom left the world CMD K: cd\myprojects\123456 .... your sample directory dir *.dwg >dwglst /b open in word dwglst.txt add 1 blank line at top replace ^p ^popen You play with adding at start or end depending on where you put the ^p eg close y ^p Quote Link to comment Share on other sites More sharing options...
rlx Posted February 24, 2018 Share Posted February 24, 2018 Rlx Word and maybe Notepad++ may support special character replacement ^t is a tab. I grew up on DOS so did lots of others here. Hi Bigal (do you ever sleep?) , I sort of grew up with dos too but just the basic stuf , simple batch files but nothing realy advanced. Thing I use for my scripts at the moment still needs some tlc and I should reserve some time to realy finish it , but you know how it goes , if it aint broken , don't fix it , or now and again a quick dirty fix. Most of my scripts are all the same format , open drawing , load lisp , run lisp and save. This app takes care of creating te master script and works in both mdi and sdi. Want to add coreconsole and maybe something like Lee's odbx wrapper. Wel i've been at it since five oçlock this morning and now it's almost two at night and my vision is realy getting blurry so time to stop. But thanx for your input , all knowledge is welcome and sometimes make you see things in a different way. gr. Rlx RlxBatch.lsp Quote Link to comment Share on other sites More sharing options...
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.