Есть ли способ изменить файл DWG AutoCAD в формат PNG или PDF, используя Python.
Я пытался найти много документации, ни один из них не ответил на мой вопрос
```
from __future__ import print_function
from os.path import join, dirname, abspath
from xlutils.copy import copy
import xlrd
import xlwt
from pyautocad import Autocad, APoint
import os
import win32com.client
from pyautocad import Autocad, APoint
from pyautocad.contrib.tables import Table
from comtypes import COMError
def props(cls):
return [i for i in cls.__dict__.keys() if i[:1] != '_']
# Create workbook
book = xlwt.Workbook()
ws = book.add_sheet("ExportedData")
book.save("Exported.xls")
# Open the workbook
xl_workbook = xlrd.open_workbook("Exported.xls")
sheet_names = xl_workbook.sheet_names()
xl_sheet = xl_workbook.sheet_by_name(sheet_names[0])
wb = copy(xl_workbook)
sheet = wb.get_sheet(0)
dwgfiles = filter(os.path.isfile, os.listdir(os.curdir))
cwd = os.path.abspath(os.path.curdir) # current working dir
print(cwd)
for f in dwgfiles:
print("++++++++++++++++++++++++++++++")
print("++++++++++++++++++++++++++++++")
print("++++++++++++++++++++++++++++++")
print("++++++++++++++++++++++++++++++")
print(f)
if f.endswith(".dwg"):
print("sdaasdas")
""" open Document"""
acad = Autocad()
print(cwd)
acad.app.Documents.open(cwd + "/" + f)
exportFile="new2.bmp"
num_cols = xl_sheet.ncols # Number of columns
idx = 1
acad = win32com.client.Dispatch("AutoCAD.Application")
doc = acad.ActiveDocument # Document object
print(dir(doc))
doc.Export('exportFile','bmp')
print("MODEL SPACE")
count=0
```
пожалуйста, помогите мне решить это? ошибка, которую я получаю, приведена ниже
**e_to_string_', '_username_', '_wrap_dispatch_']
Traceback (most recent call last):
File "auto1.py", line 63, in <module>
doc.Export(exportFile,"bmp")
File "<COMObject <unknown>>", line 3, in Export
pywintypes.com_error: (-2147352562, 'Invalid number of parameters.', None, None)**
----------------------------------------------- -------------------------------------------------- -------------------------------------------------- -------------------------------------------------- ---------------------------