Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

merge batch code with chooser file dialog box

0 REPLIES 0
Reply
Message 1 of 1
MANTONIOPM
123 Views, 0 Replies

merge batch code with chooser file dialog box

I would like to know how I could mix this code that I got from the internet to integrate it into my batch code. The code that I have obtained is used to be able to select drawing files.

CODE TO MIX:

<# : chooser.bat
:: launches a File... Open sort of file chooser and outputs choice(s) to the console

@Anonymous off
setlocal

for /f "delims=" %%I in ('powershell -noprofile "iex (${%~f0} | out-string)"') do (
echo You chose %%~I
)
goto :EOF

: end Batch portion / begin PowerShell hybrid chimera #>

Add-Type -AssemblyName System.Windows.Forms
$f = new-object Windows.Forms.OpenFileDialog
$f.InitialDirectory = pwd
$f.Filter = "Dibujo de AutoCAD (*.dwg)|*.dwg|All Files (*.*)|*.*"
$f.ShowHelp = $true
$f.Multiselect = $true
[void]$f.ShowDialog()
if ($f.Multiselect) { $f.FileNames } else { $f.FileName }

--------------------------------MI CODE------------------------------------------

set accoreexe="C:\Program Files\Autodesk\AutoCAD 2022\accoreconsole.exe"

set "source=B:\Archivos & proyectos CAD-BIM\Proyectos\Terminados\XSD\1878 CAM\Planos\09 Integracion Ambiental"

set script="%~dp0..\SCRIPTS\AUTOPUBLISH.scr"
FOR /f "delims=" %%f IN ('dir /b "%source%\*.dwg"') DO %accoreexe% /i "%source%\%%f" /s %script%
:: Comment the following line to autmatically close the console

0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report