Python Script to Open Civil3D by subprocess.Popen()

Hello,

I’m trying to start Civil 3D from Revit. For this I wrote a Python script in Dynamo that opens a program with subprocess.Popen(CivilPath).
And Civil 3D is almost open until a error message says: “DLLs canot be found” and the proccess aborts.

I also used the program link (C:\Program Files\Autodesk\AutoCAD 2020\acad.exe) to open it with cmd and it works fine and it not working with Python in Dynamo.

Does someone have any Idea?

Thanks for your Help

hello
you can use System.Diagnostics.Process ,
if you want just start Autocad

import sys
import clr
import System

System.Diagnostics.Process.Start(r'C:\Program Files\Autodesk\AutoCAD 2020\acad.exe')

if you want start program with parameters (as Civil)

import sys
import clr
import System
p = System.Diagnostics.Process()
p.StartInfo.FileName = r'C:\Program Files\Autodesk\AutoCAD 2021\acad.exe'
p.StartInfo.Arguments = '''/ld "C:\Program Files\Autodesk\AutoCAD 2021\\AecBase.dbx" /p "<<C3D_Metric>>" /product "C3D" /language "en-US" '''
p.Start()

Note: Engine IronPython

Hello,

Thank you for your response. But when using System.Diagnostics.Process I still got the SystemError cause through missing DLLs.