Run AutoCad Commands from iLogic

Run AutoCad Commands from iLogic

dalton98
Collaborator Collaborator
862 Views
2 Replies
Message 1 of 3

Run AutoCad Commands from iLogic

dalton98
Collaborator
Collaborator

Hello. I'm not sure if this is possible, but I thought I'd ask...

I found an iLogic rule online that creates a dxf file from the flat pattern view.

https://clintbrown.co.uk/2020/09/05/ilogic-export-all-flat-patterns-to-one-dxf/

 

From there I have to open the newly created dxf file and delete/rename the layers assigned in order for our burn tables to read it. I wrote a simple script to fix the layers(merges layer IV_INTERIOR_PROFILE to layer 0)

-----------------------------------------------------fileType.scr

-LAYMRG
N
IV_INTERIOR_PROFILES

 

N
0
Y

-----------------------------------------------------

Would it be possible to open the AutoCad file, run a script, and close it all in iLogic?

 

Much Appreciated,

Dalton Parrish

0 Likes
Accepted solutions (1)
863 Views
2 Replies
Replies (2)
Message 2 of 3

Michael.Navara
Advisor
Advisor
Accepted solution

You can start AutoCAD program from iLogic

In arguments you can specify drawingFileName and you can use /b script file. Here is more info

 

Sample call from iLogic can looks like this

Dim acadExe = "C:\Program Files\Autodesk\AutoCAD 2020\acad.exe"
Dim dwgFile = "C:\Path\To\Drawing.dwg"
Dim scriptFile = "C:\Path\To\TestSrcipt.scr"
Dim args = dwgFile & " /b " & scriptFile
Process.Start(acadExe, args)
0 Likes
Message 3 of 3

dalton98
Collaborator
Collaborator

@Michael.Navara 

I couldn't get that solution to work

Process.Start(dwgFile) opens the desired file, but I still dont know how to automate running the scripts.

 

Also when I tried Process.Start(acadExe, args) it gives me an error

daltonparrish_0-1647035407502.png

 

0 Likes