Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

389
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!