Very simple code:
Oleobject ole_cad
Ole_cad=create oleobject
Li_ok=ole_cad. Connecttoobject (" ", "autocad. Application")
//li_ok returns 0, but the next step will be executed error
Ls_cadver=ole_cad. Version
Since AUTOCAD2014 is 64, it is estimated that the problem was oleobject definition, kindly tell experienced counterparts, thank you so much!
CodePudding user response:
Try the connecttonewobject, the other version behind add a try ()ole
CodePudding user response:
Such as: ole_1 version ()CodePudding user response:
Use li_ok=ole_cad. Connecttoobject (" autocad. Application ") settled, not an error, thank you very much very much!Ask again, so open a new CAD file, if I want to operate the current CAD file, how to write code? Please give a hint!
CodePudding user response:
Found such a phenomenon, use first connecttoobject (" autocad. Application "), then close the program, reoccupy connecttoobject (" ", "autocad. Application")Don't make a mistake,
But I think the effect is connected to the user is currently open CAD file, there has been no good way, all the people, please give directions!
CodePudding user response:
Found such a phenomenon, use first connecttonewobject (" autocad. Application "), then close the program, reoccupy connecttoobject (" ", "autocad. Application")Don't make a mistake,
But I think the effect is connected to the user is currently open CAD file, there has been no good way, all the people, please give directions!
CodePudding user response:
To connect with connecttonewobject autocad, then use program to open the file you want