autodesk-viewerautodesk-model-derivativeautodesk-construction-cloud

Wrong element selection in Viewer


When I select pipes which are side by side in the viewer, it selects next pipe instead of itself. The hover works correct but not the selection, it's nearly like the model is shifted somehow. Because when I click on empty space (not on pipe) the nearest pipe is selected. I don't see this problem in ACC viewer. I was using SVF instead of SVF2 but although I tried the translation with new version nothing changed.

This is my code to translate the model:

const { ModelDerivativeClient,ConversionMethod,View,Type } = require("@aps_sdk/model-derivative");

  const svfPayloadFormat = {
    views: [View._2d, View._3d],
    type: Type.Svf2,
  };

const  JobPayload = {
    input: { urn: urn, compressedUrn: false }, //, rootfileName: '<>'
    output: {
      formats: [svfPayloadFormat],

    }
  };


    const job2 = await modelDerivativeClient.startJob(req.oauth_token.access_token, JobPayload);

My viewer version is: v7.109.1

What is the difference between APS viewer and ACC viewer ?

enter image description here


Solution

  • As we discussed in the comments, the incorrect selection would occur on some model formats (e.g, NWD converted from S3D) due to the default model units.

    Try to change the units when loading the model by specifying applyScaling. e.g.

    viewer.loadDocumentNode( doc, viewable, { applyScaling: 'cm' })
    

    note. The possible values of applyScaling : m, cm', mm, ft, etc.