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

typ = _vartype_to_ctype[self.vt & ~VT_ARRAY] #36

Open
shiwun opened this issue Jun 22, 2021 · 1 comment
Open

typ = _vartype_to_ctype[self.vt & ~VT_ARRAY] #36

shiwun opened this issue Jun 22, 2021 · 1 comment

Comments

@shiwun
Copy link

shiwun commented Jun 22, 2021

hello,i need your help.
i read your doc and try to use other function referening AutoCAD ActiveX documentation.
but find some error,however the function did work.
here is the codes(quite simple):

#---------------------------------------------------------------------------
from pyautocad import Autocad, APoint
acad = Autocad(create_if_not_exists=True)
p1 = APoint(0, 0, 0)
p2 = APoint(25, 0, 0)
p3 = APoint(60, 60)
line = acad.model.AddLine(p1, p2)
offset = line.Offset(12)

#---------------------------------------------------------------------------
and here is the message:

D:\pythonWorkSpace\first_folder\Scripts\python.exe D:/workspace/first_python/manipulate_cad/TestCad.py
Traceback (most recent call last):
File "D:/workspace/first_python/manipulate_cad/TestCad.py", line 14, in
offset = line.Offset(12)
File "D:\pythonWorkSpace\first_folder\lib\site-packages\comtypes\client\lazybind.py", line 182, in caller
return self._comobj._invoke(descr.memid, descr.invkind, 0, *args)
File "D:\pythonWorkSpace\first_folder\lib\site-packages\comtypes\automation.py", line 730, in _invoke
return var._get_value(dynamic=True)
File "D:\pythonWorkSpace\first_folder\lib\site-packages\comtypes\automation.py", line 457, in _get_value
typ = _vartype_to_ctype[self.vt & ~VT_ARRAY]
KeyError: 9

Process finished with exit code 1

#---------------------------------------------------------------------------
the same error occured when i use '' line.ArrayPolar(3, 3.14, p1)''
But just as i said, auto cad did work well and draw the graphics rightly.
How can i settle this? I need your help.
By the way ,the version of my auto cad is 2018.
Thanks~!

@JoLaFripouille
Copy link

I found a solution you must fix the problème in the module

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