Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

User Select Files - Open AutoCAD run Script

$
0
0
Hello all new to autoit but seems like a very nifty program to be able to write scripts to save alot of users time.

What i am after is to be able to run a .exe to allow the user to select files in the folder he/she specifies and then runs an autocad script on each of the selected files.

This is what i have so far from general browsing over the forums..

[ autoit ]      
#Include #Include #include $MyDocsFolder = "::{450D8FBA-AD25-11D0-98A8-0800361B1103}" $message = "Hold down Ctrl or Shift to choose multiple files." $var = FileOpenDialog($message, $MyDocsFolder & "\", "All Files (*.dwg*)", 1 + 4 ) If @error Then MsgBox(4096,"","No File(s) chosen")

This part allowing the user to select .dwg files from any location he/she wants with performing error message if no files selected. The idea i got was from an Autodesk University tutorial for being able to run scripts through .bat programs though I don't think its possible for .bat files to be able to have user specify files. The Code below is from the .bat functions (where path is the directory the script is stored)

For %%f in (path\*.dwg) do start /wait C:\"Program Files"\"AutoDesk"\"AutoCad 2013"\acad.exe "%%f" /b path\scriptname.scr

[ autoit ]      
Run ('"C:\Program Files\AutoDesk\AutoCad 2013\acad.exe" /b "path\scriptfilename.scr"')

This is where i got to with AutoIT being able to open up AutoCAD and being able to run a script though how do you go about setting the files previously selected as variables so you can tell AutoCAD to open each file and run the script.

Thanks for taking the time to read this and all help is much appreciated :)

Mark.

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>