Skip to main content

PsimFileNew

Usage

psim.PsimFileNew();

Python Help

py.help(psim.PsimFileNew)

Python def

def PsimFileSave(self, SchematicObj, New_SchematicFilePath):
if not self.IsValid():
print("PSIM object was not loaded.")
return 0;

schHandle = 0
if isinstance(SchematicObj, PSIM_schematic):
schHandle = SchematicObj.value

SaveSchematicFile = getattr(self.psimHandle, "SaveSchematicFileW")
if not SaveSchematicFile:
raise AttributeError(self.VersionErrorMessage)

SaveSchematicFile.restype = ctypes.c_int
# int SaveSchematicFileW(int nSchematicID, const wchar_t * szFileName, UINT nFlag)
res = SaveSchematicFile(schHandle, ctypes.c_wchar_p(New_SchematicFilePath), ctypes.c_int (0)); #returns 0 on error
if res == 0 :
print("Unable to save schematic file " + New_SchematicFilePath)
return 0;
return res