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

(-2147352567, '예외가 발생했습니다.', ('키를 찾을 수 없습니다.', 'AutoCAD.Application', 'C:\\Program Files\\Autodesk\\AutoCAD 2020\\HELP\\OLE_ERR.CHM', -2145386476, None)) #50

Open
greenaway0824 opened this issue Dec 8, 2023 · 6 comments

Comments

@greenaway0824
Copy link

I can't run an example file with the following error messages.

COMError Traceback (most recent call last)
Cell In[7], line 27
25 p2=APoint(p2x[j],p2y[j]+z)
26 line1=acad.model.AddLine(p1,p2)
---> 27 line1.layer='Beam_LSection'
28 if j >= 8:
29 line1.layer='Text'

File ~\anaconda3\lib\site-packages\comtypes\client\lazybind.py:218, in Dispatch.setattr(self, name, value)
216 descr = put or putref
217 if descr.cParams == 1:
--> 218 self._comobj._invoke(descr.memid, descr.invkind, 0, value)
219 return
220 raise AttributeError(name)

File ~\anaconda3\lib\site-packages\comtypes\automation.py:728, in IDispatch._invoke(self, memid, invkind, lcid, *args)
725 dp.rgdispidNamedArgs = pointer(DISPID(DISPID_PROPERTYPUT))
726 dp.rgvarg = array
--> 728 self.__com_Invoke(memid, riid_null, lcid, invkind,
729 dp, var, None, argerr)
730 return var._get_value(dynamic=True)

COMError: (-2147352567, '예외가 발생했습니다.', ('키를 찾을 수 없습니다.', 'AutoCAD.Application', 'C:\Program Files\Autodesk\AutoCAD 2020\HELP\OLE_ERR.CHM', -2145386476, None))

@CEXT-Dan
Copy link

CEXT-Dan commented Dec 8, 2023

Key not found, does the layer Beam_LSection exist in the drawing?

@greenaway0824
Copy link
Author

I don't know. I was just trying to run an example.

@CEXT-Dan
Copy link

CEXT-Dan commented Dec 10, 2023

then change to
ine1.layer = "0" #zero

see if it works, all drawings have a zero layer

Also, if your using AutoCAD 2021 or later, you can try this library. Its being maintained
https://github.com/CEXT-Dan/PyRx

@greenaway0824
Copy link
Author

then change to ine1.layer = "0" #zero

see if it works, all drawings have a zero layer

Also, if your using AutoCAD 2021 or later, you can try this library. Its being maintained https://github.com/CEXT-Dan/PyRx

It doesn't work perfectly but works partially and I think I can start from there. Thanks so much.
Is there any manuals or examples I can refer to?

@CEXT-Dan
Copy link

Just the autocad activex documentation. Check out theswamp.org forums for cad programming

@greenaway0824
Copy link
Author

Just the autocad activex documentation. Check out theswamp.org forums for cad programming

Thanks a lot.

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