Skip to main content

RunSimview

Usage

psim.RunSimview();

Python Help

py.help(psim.RunSimview)

Python def

def RunSimview(self, szGraphFilePath, *colNames, **name_value_pairs):
if not self.IsValid():
print("PSIM object was not loaded.")
return None;

#Start with the initial part of the string
combined_string = "ADD:B:"

# Add each single string separated by ":"
combined_string += ":".join(colNames)
combined_string += ":"

# Initialize a flag to check if any name-value pairs exist
pairs_exist = False

# Add the name-value pairs in the specified format
for name, value in name_value_pairs.items():
combined_string += ">>" + name + ">" + value
pairs_exist = True # Set the flag to True since we have at least one pair

# If we added any name-value pairs, end the string with ">>>"
if pairs_exist:
combined_string += ">>>"

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

RunSimview.argtypes = [ctypes.c_wchar_p, ctypes.c_wchar_p]
RunSimview.restype = ctypes.c_int
#int EXPORT RunSimview(const wchar_t * szSimviewFile, const wchar_t* szData)
res = RunSimview(ctypes.c_wchar_p(szGraphFilePath), ctypes.c_wchar_p(combined_string)); #returns 0 on error