WEB API Running Python API - vrNodeService.findNode() response is <vrKernelServices.vrdSwitchNode object at 0x0000018DBF4B67C0>

WEB API Running Python API - vrNodeService.findNode() response is <vrKernelServices.vrdSwitchNode object at 0x0000018DBF4B67C0>

enzoscafura
Observer Observer
249 Views
1 Reply
Message 1 of 2

WEB API Running Python API - vrNodeService.findNode() response is <vrKernelServices.vrdSwitchNode object at 0x0000018DBF4B67C0>

enzoscafura
Observer
Observer

Hi there, I am using a TypeScript service to call the python api. 

I built these methods to do a call to the API and find the node. It is working fine but I getting this serialized object <vrKernelServices.vrdSwitchNode object at 0x0000018DBF4B67C0> and when I pass it as a parameter in the function bellow, I actually get 200 but nothing happens.

 
private static callVredApiPython<T>(command: string, instanceIp: string, region: Region, httpMethod: Method, authToken: string): Promise<T> {
        const instanceUrl = VredCoreService.getVredInstanceUrl(instanceIp, region);
        instanceUrl.pathname += `/${authToken}/pythoneval2`;
        instanceUrl.searchParams.set('value', command);

        return RestService.rawAjax<void, T>(instanceUrl.toString(), httpMethod).then((response) => response?.data, RestService.throwErrorFromBackend);
    }

    public static findNode(instanceIp: string, region: Region, authToken: string, command: string): Promise<Object> {
        return VredCoreService.callVredApiPython(command, instanceIp, region, 'GET', authToken);
    }

 

 The code that I ran after is in the next block : "toggleNodeVisibility" .

 

public static toggleNodeVisibility(instanceIp: string, region: Region, authToken: string, nodeObject: Object, isVisible: boolean, childrenAreVisible: boolean): Promise<void> {
		const command = `vrScenegraphService.setNodeVisibility([${nodeObject}],${isVisible},recursive=${childrenAreVisible})`;
		return VredCoreService.callVredApiPython(command, instanceIp, region, 'GET', authToken);
	}

 

0 Likes
250 Views
1 Reply
Reply (1)
Message 2 of 2

__daniel.lincoln__
Alumni
Alumni

Hi,

 

Something to try...
const command = `vrScenegraphService.setNodeVisibility([${JSON.stringify(nodeObject)}],${isVisible},recursive=${childrenAreVisible})`;

-Dan

0 Likes