SldwrksExporter/runSimple.py

20 lines
607 B
Python
Raw Normal View History

2023-02-06 10:43:10 +00:00
# example: .\run.py path\Part1
import os
import sys
import pathlib
import subprocess
# folder input
if(sys.argv[1]):
pass
files = sys.argv[1:] # take files given in input
currentPath = str(pathlib.Path().resolve())
for i in files:
input = str(i)
commandstep = "PowerShell -NoProfile -ExecutionPolicy Bypass -File " + currentPath + "\export-step.ps1 " + input
commandPdfDxf = "PowerShell -NoProfile -ExecutionPolicy Bypass -File " + currentPath + "\export-pdf-dxf.ps1 " + input
subprocess.run(commandstep, capture_output=True)
subprocess.run(commandPdfDxf, capture_output=True)