pyautocad icon indicating copy to clipboard operation
pyautocad copied to clipboard

cannot find cad

Open unmht001 opened this issue 8 years ago • 2 comments
trafficstars

i installed 2 versions of autocad cad2017 and cad2014 mechanical , i used code like this:

from pyautocad import Autocad a=Autocad() a.prompt("hello")

cad2014 mechanical was opened , why not cad2017? how to run this in cad2017?

unmht001 avatar Feb 25 '17 03:02 unmht001

i read api.py , i found this: #----------------- def init(self, create_if_not_exists=False, visible=True): .... #-------------------- and this : #---------------- def app(self): .... self._app = comtypes.client.GetActiveObject('AutoCAD.Application', dynamic=True) #-------------------

i think , if init() and app() could know the version of autocad , will be better. like this .

self._app = comtypes.client.GetActiveObject('AutoCAD.Application.21', dynamic=True)

and it worked.

unmht001 avatar Feb 25 '17 03:02 unmht001

What is .21 in this self._app = comtypes.client.GetActiveObject('AutoCAD.Application.21', dynamic=True)?

vaish1234567 avatar Nov 20 '17 05:11 vaish1234567