Hi All,
I want to use the REST API of visualizer to load and render a certain vtk file in the data directory it’s connected to.
The following code returns 200 but there’s nothing happening in visualizer. Can you help?
mheaders = {
“Content-Type”: “application/json”
}
def load_file_into_pv():
url = “visURL”
payload = {
“method”: “openFile”,
“args”: {
“file”: “/tmp/pv/file.vtk”
}
}
response = requests.get(url, json=payload, headers=mheaders)
if response.status_code == 200:
print("File loaded successfully!")
else:
print("Failed to load file:", response.text)
def render_display():
render_url = “visURL”
payload = {“method”: “render”}
response = requests.get(render_url, json=payload, headers=mheaders)
if response.status_code == 200:
print(“Render triggered successfully!”)
else:
print(“Failed to trigger render:”, response.text)