SendCommand AutoCAD customization Python

SendCommand AutoCAD customization Python

Anonymous
Not applicable
2,951 Views
1 Reply
Message 1 of 2

SendCommand AutoCAD customization Python

Anonymous
Not applicable

Hi,

 

I would like to convert dwg to jpg with python script. 

Currently, I am using Export function to convert to bmp, then to jpg

import win32com.client

acad = win32com.client.dynamic.Dispatch("AutoCAD.Application")

doc = acad.ActiveDocument

doc.Export(directory,"bmp", None)

 

The resolution from export function is quite low, so I would like to use plotter, but I have problem with SendCommand.

doc.SendCommand('_-PLOT ' Y' 'Model ' 'PublishToWeb JPG.pc3 ')

It doesn't work correctly. I know that in VBA SendCommand works with  '& vbCr +'. How to implement SendComand in Python?

Is there another way to optain high resolution?

 

 

 

 

 

 

0 Likes
2,952 Views
1 Reply
Reply (1)
Message 2 of 2

Sea-Haven
Mentor
Mentor

Is it because your -plot is to short

 "-PLOT"  "Y"  "" "DWG To PDF" "Iso full bleed A3 (420.00 x 297.00 MM)" "m" "LANDSCAPE"  "N"   "W"  "-6,-6" "807,560" "1=2"  "C" "y" "Acad.ctb" "Y"	"n" "n" "n" pdfName "N" "y"
    
0 Likes