You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get this error when deleting all objects, but it is ok to delete an object individually.
from pyautocad import Autocad, APoint
acad = Autocad(create_if_not_exists=True)
L1 = acad.model.AddLine(APoint(0,0), APoint(500,250))
L2 = acad.model.AddLine(APoint(0,100), APoint(500,600))
for obj in acad.iter_objects():
obj.Delete()
it returns:
COMError Traceback (most recent call last)
d:\02 Work\02 Projects Piotr\LEARNING\pyautocad_learn\math_array_autocad.py in <cell line: 1>()
----> 1 for obj in acad.iter_objects():
2 obj.Delete()
~\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pyautocad\api.py in iter_objects(self, object_name_or_list, block, limit, dont_cast)
118 count = block.Count
119 for i in xrange(count):
--> 120 item = block.Item(i) # it's faster than `for item in block`
121 if limit and i >= limit:
122 return
~\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\comtypes\client\lazybind.py in caller(*args)
180 # DISPATCH_METHOD
181 def caller(*args):
--> 182 return self._comobj._invoke(descr.memid, descr.invkind, 0, *args)
183 try:
184 caller.__name__ = name
~\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\comtypes\automation.py in _invoke(self, memid, invkind, lcid, *args)
743 dp.rgvarg = array
744
--> 745 self.__com_Invoke(memid, riid_null, lcid, invkind,
746 dp, var, None, argerr)
747 return var._get_value(dynamic=True)
COMError: (-2147352567, 'Exception occurred.', (None, None, None, 0, None))
I noticed (from AutoCAD) the first object is deleted but not the 2nd one (in the case of two objects).
If I have a lot of objects, some are deleted, and some are not.
It is ok when i do L1.Delete() or L2.Delete(),
Is there anything wrong? Thanks a lot!
system: Windows 10, Python 3.9.13, pyautocad 0.2.0 , AutoCAD 2023
-teko-
The text was updated successfully, but these errors were encountered:
Hi all,
I get this error when deleting all objects, but it is ok to delete an object individually.
it returns:
I noticed (from AutoCAD) the first object is deleted but not the 2nd one (in the case of two objects).
If I have a lot of objects, some are deleted, and some are not.
It is ok when i do
L1.Delete()
orL2.Delete(),
Is there anything wrong? Thanks a lot!
system: Windows 10, Python 3.9.13, pyautocad 0.2.0 , AutoCAD 2023
-teko-
The text was updated successfully, but these errors were encountered: