Revit 23 CategoryByName

How come my Category.ByName isn’t giving me Ceilings and Roofs?

I don’t want the analytical ones.

I can’t seem to recreate your issue…

Although I did notice that i get unexpected behaviour when using an array of strings…

What if you only try to get the Ceilings category by name, but without using an array

I’m in Revit 23.

I never had the issue in Revit 21.

I got the same result, so wanted to check is there more categories and this is what I got.

Guess it’s the best way to get categories by ID, should be always consistent with the enums.

Is the ID the same in each Revit project though?

They don’t change based on the project, that is the built in category id. I think they can only change depending on the Revit version (but I don’t think the most used ones have changed).

You can find the list of categoryIds here:
https://www.autodesk.com/support/technical/article/caas/sfdcarticles/sfdcarticles/How-to-find-Category-ID-list-for-Family-Type-parameter-type-in-shared-parameters-in-Revit.html

Or just get the dropdown categories node in dynamo and get the id of the category you desire:

image

But this issue with Category.ByName should still be fixed.

Hope it helps a bit.

2 Likes

Thanks, I may do that (after sulking a little).

Anyone at Autodesk … Is this a known glitch? @jacob.small ?

1 Like

Flagged dev for you about 2 minutes before the @ mention.

Make sure you have fully patched 2023 as a start.

1 Like

Dev is indicating a fix in a future build. I am pushing for a fix in prior builds as a node not working reliably in 50% of the supported versions isn’t something the team wants to see.

The fix noted above and the fix linked in this GitHub issue should help for the time being: Incorrect Category returned by Category.ByName node · Issue #2870 · DynamoDS/DynamoRevit · GitHub

2 Likes

IT has just told me I’m 2 versions out of date for the patches.
They’re going to update me now…

But you’re saying this won’t help.

Instead of choosing the categories I wanted I selected the categories I didn’t want… They all work (so far).
I was turning elements on and off in a view.

1 Like

Not with this, but you need those updates anyway for security reasons.

I knew you’d say that :smiley:

2 Likes

@jacob.small am I right in remembering that there was some stability added to the ‘Category Selection Dropdowns’ so that they ‘remember’ more accurately what category was selected initially?

Essentially removing the error of opening a graph and finding all the categories had changed?

This would circumnavigate the need for any of the above if you’ve got that patch in the version of Dynamo you’re using in Revit 23 @Alien

Correct - if my recollection on which version is right, this is only an issue in 2021 at the moment, which will be unsupported in a half year or so. @Alien this might be worth testing on your end.

That said, utilizing the ‘by name’ node does help in a lot of situations (typing 30 string is easier than setting up 30 drop downs).

1 Like

Yea I thought as much. Good to know cheers.

Agreed RE: still useful functionality to have, just might help @Alien as a quicker fix for now rather than looking up cat IDs

Like Jacob said… 30 drop downs is a no :smiley:

I’ve done it the opposite way round… Hiding items I don’t want, rather than ones I do.

Irritating but it’s working.

What you on about it’s fine :sweat_smile: :upside_down_face:

6 Likes

I have a working timeline for a fix. Nothing I can share, but wanted to share that a light at the end of the tunnel does exist.

1 Like

Faster than they’ll fix the date issue then? :crazy_face:

FWIW monocle uses Category.ById because the team broke this a while back.

3 Likes