def PsimFileOpen(self, SchematicFilePath) :
if not self.IsValid():
print("PSIM object was not loaded.")
return 0;
SimOpenSchematicFileW = getattr(self.psimHandle, "SimOpenSchematicFileW")
if not SimOpenSchematicFileW:
raise AttributeError(self.VersionErrorMessage)
SimOpenSchematicFileW.restype = ctypes.c_int
if (SchematicFilePath is None) or (SchematicFilePath == ""):
return PSIM.PsimFileNew(self);
SchematicID = SimOpenSchematicFileW(ctypes.c_wchar_p(SchematicFilePath), ctypes.c_int (0X00001000));
if SchematicID == 0 :
print("Unable to open schematic file " + SchematicFilePath)
return None;
sch = PSIM_schematic(self, SchematicID)
return sch