PsimEnableElm3
Usage
psim.PsimEnableElm3();
Python Help
py.help(psim.PsimEnableElm3)
Python def
PSIM 2024 and above:
def PsimEnableElm3(self, SchematicObj, ElmIndex, enable):
# class PSIM_Element:
# def __init__(self, type, name, i):
# self.Type = type
# self.Name = name
# self.Params = [] #array of PSIM_param objects
# self.Index = i
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), ctypes.c_wchar_p(None), ctypes.c_wchar_p(None), ctypes.c_int(ElmIndex), ctypes.c_int(enable)); #returns 0 on error
if res == False:
print("Unable to update element with index:" + str(ElmIndex) + "\n")
return False;
return True;