Is there a way to load multiple drw files into session at once?
Ah yes, and a script that would grab all the filenames for you and customize the trail file automatically.
One day, when I'll be bored too much...
Good point, Tom.
If all you want is to open them, an AutoIt script would handle that nicely. VBA can cover it also, but AutoIt has a smaller footprint.
AutoIt has a function to pull data from the clipboard, which could be a list copied from anywhere you would create a list.
The following takes entries copied from Excel to the clipboard and separates them into single lines. StringSplit automatically resizes the array to match the number of entries. I'm not even sure it needs a 'dim' command, but it is a good practice.
$excel = ClipGet()
Once each line is in the array, then use Send to direct commands to the ProE window to do what you want.
If you create mapkeys, that can make the process easier.
In a FOR loop you could SEND("open_file") to run the mapkey "open_file".and then SEND(excellines[$i] &@CRLF) to send the name of each file in turn. Follow with SEND("Process_drawing") and the "Process_drawing" mapkey will run to do whatever you want to do to the drawing.
You know, I favor AutoHotkey. It's actually pretty similar to AutoIT.
With AHK, It's possible to search for files in a specific folder based on file type, and list an array of all the filenames. Once having that list, AHK could also generate a trail file that would handle the open and close commands of each of the Creo files listed.
Using SEND command in AHK is abit tricky with Creo, or any other app. What if the drawing is large? How long does the script has to wait? It can be done with AHK script, but these are simply the things that are better off done on app level (in Creo).
AutoIt is much more capable than AutoHotKey. I would list the available base functions, but there look to be over a thousand, including direct Word and Excel controls. AutoIt can get a lot of information about its environment to tell what step things are at and mapkeys can include steps that make information easier to get. Unless you have a working alternative, try AutoIt.
From AutoIt Help:
AutoIt v3 is a freeware BASIC-like scripting language designed for automating the Windows GUI and general scripting. It uses a combination of simulated keystrokes, mouse movement and window/control manipulation in order to automate tasks in a way not possible or reliable with other languages (e.g. VBScript and SendKeys). AutoIt is also very small, self-contained and will run on all versions of Windows out-of-the-box with no annoying "runtimes" required!
AutoIt was initially designed for PC "roll out" situations to reliably automate and configure thousands of PCs. Over time it has become a powerful language that supports complex expressions, user functions, loops and everything else that veteran scripters would expect. Features:
I remember reading the AHK forums back when I was learning Autohotkey, and It was all pretty much the same but the other way around.
Lots of posts there say that AHK is much more capable than AutoIT, coming from alot of people that never really used AutoIT.
It's just a matter of personal preference. AHK and AutoIT are pretty similar but on the other side alot different. AHK is just an interpereter of C++ language running on Win OS, and for me that's fine, cause I like the programming rather than scripting nature of it.
Well, if one was better, the other one would not be there or at least the devs would quit working on the worse one. So, I guess none is better, they are both just different products.
They appear to be similar - because AHK started with old AutoIt source.
"Before AutoHotKey existed, AutoIT v3 was open source. According to the AHK help file, AutoHotKey adapted source code from AutoIT v3 such as Window Spy and the script compiler. When Autohotkey launched, disagreement happened between the creators of AutoIt and Autohotkey because Autohotkey placed advertisements on Google that directly targeted AutoIt v3 searches and displayed Autohotkey as a "sponsored link" ad for Autohotkey app. This included posts on the AutoIt forum that the Autohotkey creator posted with link to his software. Shortly afterwards, a new version of AutoIt was released as closed source."
AHK : AutoIt = Solidworks : Pro/Engineer
That said, I'd recommend AutoIt over AHK to new users for easier syntax, but if you are used to AHK then that's good too.
(edit to remove unwanted auto-emoji.)
Nice, there is also an AHK versus AutoIt page. Well, looks like I'm not switching from AHK to AutoIt. It'd be too much work, and there'd be no real value.
I've got to tell, AHK was a pain in a butt to learn, but I've been able to make some really large scripts, so I guess I passed through the basics.
One example of script I made is for applying parameters and relations, that are listed outside of Creo in *.txt files to a Pro/E part file. So, when I get Pro/E or Creo part from a vendor, meaning it's not based on my part template, I can just load in all of the necesarry parameters in with one macro. Then fill these parameters with required data with another macro that applies and deletes relations afterwards leaving just a timestamp, and that way I can inherit any part file, and start making drawing off of it right away.
Solidworks and Pro/E can't be compared that easily as AHK and AutoIt can, but let's not start discussion on that one.
Hi please vote on my idea about "Multiple file open functionality":
That link throws an error.
If you ask me, I have no idea how to point to an idea. These forums are just troublesome.
Well, my guess is there's no real reason to bother with getting votes for ideas anyway.
If you look at the contents of the URL when you click on the link above, it has a portion in there twice. If you click on the URL address box and remove the duplicates, you can get to the link he posted. Here is a idea from Antonius about fixing this:
(After pasting this, and typing this portion of the note, I click on the link I added and then "un-click" or "un-check the "A" with the little piece of chain next to it. When you finalize your reply, it will re-establish the link without replicating a portion of it)
Unclick? Uncheck? Unlink?
Thanks Dale for the reply, and trying to enlighten me, but you know I'm here to read about Pro/E, Creo and other CAD related stuff.
I'd think this problem didn't even have to go as far as to the ideas section, and yet being resolved as "FOR FUTURE CONSIDERATION". Bah.....
I could use this capability also. I would like to open 10-15 drawings at once, make required changes to one drawing at a time and close it. Then, when complete with this batch, open another 10-15 and do it again. It's a pain to track individual files when you have 50 to blast through and make "last pass" or other changes to a drawing package.
Nice GUI. I'd like to be able to bring in a bunch of *.drw files, but the other filetypes might be usefull as well.
Thanks for the idea.
Hello, sorry for reviving old post but this problem still exists in 2020. Can you please share your "Bring Into Session" tool?
I´ve been playing with Autoit from times to times.
I made this small script for automation, it´s not very fancy but it´s working for me.
I called it TrailMaker.
Here´s how it works:
1 - Open Creo
2 - Set Working Directory
3 - Call mapkey "trail".
4 - A text file with all files in working directory will popup, erase the ones you don´t want to open and save the file
5 - You´re asked for a trailfile to execute inside of selected files, you may create your owns
6 - Watch Creo working while drinking a cup of tea.
In your case, since you don´t want to execute nothing inside of the files, choose the blank.txt trailfile.
More instructions on Readme.txt.
That's really good script, Jose.
Nice to see something that works. I'll propably use it until I can drag myself to write my own. Thanks for the upload.
I found a nice way to filter files just adding a pause to the first mapkey. Now it´s more usable, you can select prt, asm, drw, iges, step, etc..
You can even use it to import files in batch mode.
Download the file again, and just replace the mapkeys on config.pro.
I've done a similar thing using Python script. I'm using python to write a mapkey with variable like the name in the mapkey, location and file extensions. Normally it means creating a CSV file with of list of parts based on certain parameters. The same mapkey then run the python script which will create another mapkey, and once it's done I run the mapkey that was just created. All in one push of a button.
Works like a dream as long as the parameters are correctly set.
Another possible application is to export all instances of a family table to a neutral format.
God, I´m really happy with my small script now .
Great little tweak to your script, Jose.
I'm glad you've made some progress with your little batch converter.
If I wanted to convert my parts to STEP files all at once I'd also need the script to suppress all hole features for me, cause all my models usually go to a machine shop, but hey that's also possible