Revit Lookup problem with CategoryId

Shai.Nguyen
Advocate

Revit Lookup problem with CategoryId

Shai.Nguyen
Advocate
Advocate

Hi Jeremy and everyone,

First of all, I would like to thanks Jeremy Tammik, who create Revit Lookup so I can easily find all information of an element.

When I debug a view schedule, its DefinitionId.CategoryId has a value (-2008044), but when I lookup in revit, DefinitionId.CategoryId is null.

Why in this case it's null? Because I want to lookup which category this view schedule belong to.

cat1.png

cat2.PNGThank you,

Shai.

0 Likes
Reply
913 Views
3 Replies
Replies (3)

jeremytammik
Autodesk
Autodesk

Thank you for your appreciation. Glad you like it.

 

A negative category id refers to a built-in category.

 

Look at the BuiltInCategory enumeration values in the debugger and you will see:

 
 
I cannot comment on why you see different values in the two places.
 
Cheers,
 
Jeremy
 


Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes

jlpgy
Advocate
Advocate

Hi:

I looked up the API help document.

Enum integer value -2008044 is 'OST_PipeCurves'.

This element should be a Pipe or FlexPipe.

        public static BuiltInCategory GetBuiltInCategory(this Element elem)
        {
            Category category = elem.Category;
            if (category == null) return BuiltInCategory.INVALID;
            return (BuiltInCategory)category.Id.IntegerValue;
        }

Very wierd, I'm not familiar with ViewSchedule.Robot Sad

单身狗;代码狗;健身狗;jolinpiggy@hotmail.com
0 Likes

Shai.Nguyen
Advocate
Advocate

I'm not quite sure but I expect its value like this instead of null

categoryid.PNG

Otherwise is there any other way to find category which view schedule is belong to by Revit Lookup?

0 Likes