Skip to main content

PsimEnableElm2

Usage

psim.PsimEnableElm2();

Python Help

py.help(psim.PsimEnableElm2)

Python def

def PsimEnableElm2(self, SchematicObj, ElmType, ElmName, enable):
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

PsimEnableElm = getattr(self.psimHandle, "PsimEnableElmW")
if not PsimEnableElm:
raise AttributeError(self.VersionErrorMessage)

PsimEnableElm.argtypes = [ctypes.c_int, ctypes.c_wchar_p, ctypes.c_wchar_p, ctypes.c_int, ctypes.c_int]
PsimEnableElm.restype = ctypes.c_int
#int PsimEnableElm(int nID, const wchar_t* szType, const wchar_t* szName, int nIndex, int nEnable)
res = PsimEnableElm(ctypes.c_int(schHandle), ElmType, ElmName, ctypes.c_int(-1), ctypes.c_int(enable)); #returns 0 on error
if res == False:
print("Unable to update element. Type:" + ElmType + " Name:" + ElmName + "\n")
return False;
return True;