Skip to main content

PsimSetElmValue3

Usage

psim.PsimSetElmValue3();

Python Help

py.help(psim.PsimSetElmValue3)

Python def

PSIM 2024 and above:

def PsimSetElmValue3(self, SchematicObj, ElmIndex, varName, varValue):
if not self.IsValid():
print("PSIM object was not loaded.")
return None;
schHandle = 0
if isinstance(SchematicObj, PSIM_schematic):
schHandle = SchematicObj.value
else:
return False
PsimSetEV = getattr(self.psimHandle, "PsimSetElmValueW")
if not PsimSetEV:
raise AttributeError(self.VersionErrorMessage)

PsimSetEV.argtypes = [ctypes.c_int, ctypes.c_wchar_p, ctypes.c_wchar_p, ctypes.c_int, ctypes.c_wchar_p, ctypes.c_wchar_p]
PsimSetEV.restype = ctypes.c_int
#int PsimSetElmValueW(int nID, const wchar_t* szType, const wchar_t* szName, int nIndex, const wchar_t* szVarName, const wchar_t* szVarValue)
res = PsimSetEV(ctypes.c_int(schHandle), ctypes.c_wchar_p(None), ctypes.c_wchar_p(None), ctypes.c_int(ElmIndex), ctypes.c_wchar_p(varName), ctypes.c_wchar_p(varValue)); #returns 0 on error
if res == False:
print("Unable to update element with index:" + str(ElmIndex) + " VarName:" + varName + " varValue:" + varValue + "\n")
return False;
return True;