Python and accoreconsole
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have successfully created a few batch (.bat) files to cycle through drawings for various tasks calling accoreconsole. Batch code is kind of foreign to me and not my strength, and I'm thinking Python would be more than capable of replacing my bat scripts.
I've played around with subprocess.Popen and os.system but can't quite get over the hump. Can someone share a simple script that opens and existing dwg in accoreconsole, then draws a line from 0,0 to 500, 1200, then saves and exits.
I know the following python script is wrong but posting this for conceptual purposes, to help the conversation:
import subprocess
subprocess.Popen(['C:\somedir\somedwg.dwg', 'l', '0,0', '500,1200', ' ', 'save', 'quit'])
I'm not grasping how Python subprocess passes scripting to the console.
Any help would be much appreciated.
Thank you,
Tyler
AutoCAD2022