aritra666 - 2018-12-25

Cannot import .gdc file using scripts.

Code given below...

#---------- Import handler class
class Handler(NativeImportHandler):
def conflict(self, name, obj, guid):
print("Object already exists: ",name)
return NativeImportResolve.skip

def progress(self, name, obj, exception):
print("in progess: ", name)

def skipped(self, list):
for obj in list:
print("Skipped: ", obj.get_name())
def importFilter(name, guid,type,path):
return True;

handler = Handler()

#----------
proj = projects.primary

found = proj.find("Application", True)
app = found[0]

##Select Ethercat
drbus = proj.find('EtherCAT_Master', True)[0]
Drive_1 = drbus.find("Drive1",True)[0]
if Drive_1:
Drive_1.import_native("C:\Users\Aritra\Desktop\Exported files\Drive1.gdc", importFilter, handler)
else:
print("Drive Not Found")