Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Room Name and Room Number parameter values for Spaces

12 REPLIES 12
Reply
Message 1 of 13
sobon.konrad
1618 Views, 12 Replies

Room Name and Room Number parameter values for Spaces

sobon.konrad
Advocate
Advocate

I ran into this weird behavior where if I expand a Revit MEP model into memory using:

 

mepDoc = activeDoc.Application.OpenDocumentFile(modelPath, openOptions);

and then try to query its Spaces for corresponding room properties like so: 

 

foreach(Space s in allSpaces)
            {
                string sName = s.get_Parameter(BuiltInParameter.SPACE_ASSOC_ROOM_NAME).AsString();
                string sNumber = s.get_Parameter(BuiltInParameter.SPACE_ASSOC_ROOM_NUMBER).AsString();

it will always return "Unoccupied" for both values. However, when I query model elements using Revit Lookup Tool i am clearly seeing a proper room name and number displayed there. 

Is there a limitation to using OpenDocumentFile() method that prevents this type of query? Does anyone has better idea for doing this?

 

Thank you,

 

Konrad

0 Likes

Room Name and Room Number parameter values for Spaces

I ran into this weird behavior where if I expand a Revit MEP model into memory using:

 

mepDoc = activeDoc.Application.OpenDocumentFile(modelPath, openOptions);

and then try to query its Spaces for corresponding room properties like so: 

 

foreach(Space s in allSpaces)
            {
                string sName = s.get_Parameter(BuiltInParameter.SPACE_ASSOC_ROOM_NAME).AsString();
                string sNumber = s.get_Parameter(BuiltInParameter.SPACE_ASSOC_ROOM_NUMBER).AsString();

it will always return "Unoccupied" for both values. However, when I query model elements using Revit Lookup Tool i am clearly seeing a proper room name and number displayed there. 

Is there a limitation to using OpenDocumentFile() method that prevents this type of query? Does anyone has better idea for doing this?

 

Thank you,

 

Konrad

Tags (2)
12 REPLIES 12
Message 2 of 13
Anonymous
in reply to: sobon.konrad

Anonymous
Not applicable
Could it be it has something to do with phases ? I had an issue once with windows not reporting the FromRoom parameter and it turned out I was search in the wrong phase. Maybe this is the case here.
0 Likes

Could it be it has something to do with phases ? I had an issue once with windows not reporting the FromRoom parameter and it turned out I was search in the wrong phase. Maybe this is the case here.
Message 3 of 13
Revitalizer
in reply to: sobon.konrad

Revitalizer
Advisor
Advisor

Hi,

 

what about doc.GetRoomAtPoint(space.Location) ?

 

 

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine





0 Likes

Hi,

 

what about doc.GetRoomAtPoint(space.Location) ?

 

 

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine





Message 4 of 13
sobon.konrad
in reply to: Revitalizer

sobon.konrad
Advocate
Advocate

Revitalizer,

 

I saw your previous post on a similar issue. Yes, that's what i used in the meantime, but i wanted to raise the issue here for the Dev team. It would be nice if they could enable this feature (if that's even the issue). Thank you for the suggestion. 

 

 

0 Likes

Revitalizer,

 

I saw your previous post on a similar issue. Yes, that's what i used in the meantime, but i wanted to raise the issue here for the Dev team. It would be nice if they could enable this feature (if that's even the issue). Thank you for the suggestion. 

 

 

Message 5 of 13
sobon.konrad
in reply to: Anonymous

sobon.konrad
Advocate
Advocate

Remy,

 

Phases are not an issue here. Thank you for the suggestion though. 

0 Likes

Remy,

 

Phases are not an issue here. Thank you for the suggestion though. 

Message 6 of 13
Revitalizer
in reply to: sobon.konrad

Revitalizer
Advisor
Advisor

Hi Konrad,

 

yes, it's better to report it to the Autodesk people than just live with a bug.

On the other side, it may be that you wait for years before a bug has been fixed.

 

By the way, I'm just diving into Dynamo, and I really like your contributions.

Thank you this way.

 

 

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine





0 Likes

Hi Konrad,

 

yes, it's better to report it to the Autodesk people than just live with a bug.

On the other side, it may be that you wait for years before a bug has been fixed.

 

By the way, I'm just diving into Dynamo, and I really like your contributions.

Thank you this way.

 

 

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine





Message 7 of 13
Aaron.Lu
in reply to: sobon.konrad

Aaron.Lu
Autodesk
Autodesk
Dear Konrad, would you please upload a simple rvt file for me to try? I did a test by myself and could not reproduce it.


Aaron Lu
Developer Technical Services
Autodesk Developer Network
0 Likes

Dear Konrad, would you please upload a simple rvt file for me to try? I did a test by myself and could not reproduce it.


Aaron Lu
Developer Technical Services
Autodesk Developer Network
Message 8 of 13
sobon.konrad
in reply to: Aaron.Lu

sobon.konrad
Advocate
Advocate

Here are the two files that I was briefly testing this on. 

 

 

0 Likes

Here are the two files that I was briefly testing this on. 

 

 

Message 9 of 13
Aaron.Lu
in reply to: sobon.konrad

Aaron.Lu
Autodesk
Autodesk
Dear, did you try following built in parameters?

ROOM_NAME
ROOM_NUMBER

I can get name and number correctly.

they are different from:
Room Number | SPACE_ASSOC_ROOM_NUMBER
Room Name | SPACE_ASSOC_ROOM_NAME


Aaron Lu
Developer Technical Services
Autodesk Developer Network
0 Likes

Dear, did you try following built in parameters?

ROOM_NAME
ROOM_NUMBER

I can get name and number correctly.

they are different from:
Room Number | SPACE_ASSOC_ROOM_NUMBER
Room Name | SPACE_ASSOC_ROOM_NAME


Aaron Lu
Developer Technical Services
Autodesk Developer Network
Message 10 of 13
sobon.konrad
in reply to: Aaron.Lu

sobon.konrad
Advocate
Advocate

Aaron,

 

I wanted to get the Space's Associated Room Name and Number. What you are suggesting would give me a Name and Number of the Space itself. I didn't want that. 

Can you please log this is a bug, if indeed you can confirm that for some unexplained reason those two return invalid values? 

 

Thank you! 

0 Likes

Aaron,

 

I wanted to get the Space's Associated Room Name and Number. What you are suggesting would give me a Name and Number of the Space itself. I didn't want that. 

Can you please log this is a bug, if indeed you can confirm that for some unexplained reason those two return invalid values? 

 

Thank you! 

Message 11 of 13
Aaron.Lu
in reply to: sobon.konrad

Aaron.Lu
Autodesk
Autodesk
ok. But look at UI, I see "Unoccupied" too, what should we get a different value from UI?


Aaron Lu
Developer Technical Services
Autodesk Developer Network
0 Likes

ok. But look at UI, I see "Unoccupied" too, what should we get a different value from UI?


Aaron Lu
Developer Technical Services
Autodesk Developer Network
Message 12 of 13
sobon.konrad
in reply to: Aaron.Lu

sobon.konrad
Advocate
Advocate

There are some extra rooms that are not placed and those will return Unoccupied. I was referring to the ones that are properly placed and bounded, yet still return Null or Unoccupied. Can you see that? 

0 Likes

There are some extra rooms that are not placed and those will return Unoccupied. I was referring to the ones that are properly placed and bounded, yet still return Null or Unoccupied. Can you see that? 

Message 13 of 13
Aaron.Lu
in reply to: sobon.konrad

Aaron.Lu
Autodesk
Autodesk

Dear konrad,

 

the problem does not appear in Revit 2015 and 2016, if you are using thoese versions, the problem should be got fixed.

 



Aaron Lu
Developer Technical Services
Autodesk Developer Network
0 Likes

Dear konrad,

 

the problem does not appear in Revit 2015 and 2016, if you are using thoese versions, the problem should be got fixed.

 



Aaron Lu
Developer Technical Services
Autodesk Developer Network

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report