reclosedev / pyautocad

AutoCAD Automation for Python ⛺
http://pypi.python.org/pypi/pyautocad/
BSD 2-Clause "Simplified" License
506 stars 143 forks source link

COM Error -2147352567 -2145320944 autocad new version #57

Open pyautocad opened 5 months ago

pyautocad commented 5 months ago

Hello everyone,

I erase an old version of autocad and downloaded the 2025 one. Many errors are displayed:

I tested some simple examples:

>>> from pyautocad import Autocad, APoint

>>> acad = Autocad(create_if_not_exists=True)

>>> acad.prompt("Hello, Autocad from Python\n")

Hello, Autocad from Python

this works but for this one, it doesn't

import pyautocad

acad = pyautocad.Autocad()

center_point = pyautocad.aDouble(5, 5) # ← ← ←

radius = 3

circle = acad.model.AddCircle(center_point, radius) Traceback (most recent call last): File "", line 1, in File "C:\Users\allou\AppData\Local\Programs\Python\Python312\Lib\site-packages\comtypes\client\lazybind.py", line 166, in caller return self._comobj._invoke(descr.memid, descr.invkind, 0, *args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\allou\AppData\Local\Programs\Python\Python312\Lib\site-packages\comtypes\automation.py", line 843, in _invoke self.__com_Invoke(memid, riid_null, lcid, invkind, dp, var, None, argerr) _ctypes.COMError: (-2147352567, 'Une exception s’est produite.', ("Le nombre d'éléments dans SafeArray est incorrect", 'AutoCAD.Application', 'C:\Program Files\Autodesk\AutoCAD 2025\HELP\OLE_ERR.CHM', -2145320944, None))

print("Circle drawn successfully.") Circle drawn successfully

Do you have any idea please?

CEXT-Dan commented 5 months ago

center_point must have x, y, z