Bandu W
Bandu W

Reputation: 109

Forge Viewer streamingV2 api doesn't work with BIM360

When I am using 'streamingV2' api to view a BIM model in BIM360, I am seeing '404 error' failing to fetch the manifest. When I change api to 'derivativeV2' it works except isSVF2() and isOTG() returns false (understandable).

In BIM360 viewer, isSFV2() is true, meaning my model is properly translated.

What is the right way to view SVF2 from BIM360 models? My code as as follows:

    var options = Object.assign({}, viewerOptions, {
        env: props.env || 'AutodeskProduction2',
        api: props.api || "streamingV2", // for models uploaded to EMEA change this option to 'streamingV2_EU'
        getAccessToken: async function (onTokenReady: (token: string, timeInSeconds: number) => void) {
            let token = await props.getToken();
            var timeInSeconds = 3600; // Use value provided by Forge Authentication (OAuth) API
            onTokenReady(token, timeInSeconds);
        },
    });

Any help would be appreciated.

Thanks. Bandu.

Upvotes: 0

Views: 366

Answers (1)

Bandu W
Bandu W

Reputation: 109

Thanks to Xiaodong for helping me to figure this out.

When BIM360 tip (in the format of xxx?version=2) is converted to base64, it appears with a '/'). This format works if you set viewer api to 'derivativeV2' (as in the past). However, 'streamingV2' (for SVF2) requires it to be '_' instead.

I added urn.replace('/', '_') to my code, and it works now.

Upvotes: 2

Related Questions