Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COM Error -2147352567 -2145320944 autocad new version #57

Open
pyautocad opened this issue Jun 9, 2024 · 1 comment
Open

COM Error -2147352567 -2145320944 autocad new version #57

pyautocad opened this issue Jun 9, 2024 · 1 comment

Comments

@pyautocad
Copy link

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
Copy link

CEXT-Dan commented Jun 9, 2024

center_point must have x, y, z

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants