Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

394
Vistas
Autodesk Forge Viewer: categoryFilter for getBulkProperties2 not working at all

I've got an Autodesk Forge Viewer toolbar extension for which I'm attempting to retrieve a filtered list of elements from the current model. I'm attempting to use getBulkProperties2 for this since it specifically includes categoryFilter in the options object, which would (hypothetically, at least) save me from having to pull everything and do the filtering manually.

I've wrapped the call to getBulkProperties2 in a promise to make it easier to deal with:

function getBulkProperties(model, dbIds, options) {
    return new Promise(function (resolve, reject) {
        model.getBulkProperties2(dbIds, options, resolve, reject);
    });
}

From there, I make a call to this function once the model has been successfully loaded by adding an event listener and including it in the callback:

viewer.addEventListener(Autodesk.Viewing.OBJECT_TREE_CREATED_EVENT, async function (e) {
    var props = await getBulkProperties(viewer.model, AllDbIds, { categoryFilter: ["Revit Rooms"] });
});

Unfortunately, with the categoryFilter option configured this way, the result is always an empty array. I've tried several different configurations of this but the result is always the same.

If I make the same request omitting the categoryFilter option and filter the list manually in the browser console, I can see that the elements I'm looking for do in fact exist, in exactly the configuration I'm looking for:

› props.filter(p => p.properties.some(v => v.displayName == 'Category' && v.displayValue == 'Revit Rooms')).length
‹ 113

Does this mean the categoryFilter just doesn't work? Or am I somehow not using it correctly?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Note that the categoryFilter refers to property categories (for example, "Identity Data"), not Revit categories (like the "Revit Rooms" in your example).

https://imgur.com/a/5ipSnMc

If you only want to fetch the properties for "Revit Rooms", you could probably try and find the "Rooms" object in the model browser, find the dbIDs of all its children, and then pass those dbIDs to the getBulkProperties2 method.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda