Results 1 to 4 of 4

Thread: Room.Name is really Room Name + Room Number

  1. #1
    Login to Give a bone
    0

    Default Room.Name is really Room Name + Room Number

    Hello All,

    I'm wondering why when I reference a room object in my Revit project and query the Room.Name property the Room name and room number are returned in the same string. For example

    In my project I have a room whose Name value = 'OFFICE' and whose Number value = '101'

    Autodesk.Revit.Elements.Room rm
    rm.Name

    returns:

    OFFICE 101

    Each time I Get() the .Name value I have to remove the Room Number. The Set() function, however, works as expected.

    One of the API examples (\Revit 2009 SDK\Samples\RoomSchedule\) seems to have run afoul of this anomoly because when you look at the included sample XLS file the room number is appended several times. See the 'Room Name' column in the file 'RoomSchedule.xls' to see what I mean.

    It's easy to write a function to parse the room name, but still the current return value seems like odd behavior to me.


    Thanks,

    Trevor

  2. #2
    AUGI Addict
    Join Date
    2003-11
    Location
    New Zealand
    Posts
    1,116
    Login to Give a bone
    0

    Default Re: Room.Name is really Room Name + Room Number

    This is standard behaviour (as of RAC2008? API). To get the name and number independently get the BuiltInParameter's ROOM_NAME and ROOM_NUMBER.

    Cheers,

    Guy

  3. #3
    Login to Give a bone
    0

    Default Re: Room.Name is really Room Name + Room Number

    Thanks for the reply! I looked into the RvtMgdDbg project and also found the answer there.

    Trevor

  4. #4
    Member
    Join Date
    2008-07
    Posts
    18
    Login to Give a bone
    0

    Default Re: Room.Name is really Room Name + Room Number

    One easy way is to use the C# String split method.
    Obtain the room name and room number. Find the string room number in the room name.
    Then trim the room name after getting the index of the room number.

    String fullname = _room.Name;

    String justname = fullname.Substring(0, fullname.IndexOf(_room.Number));

    Hope this helps.

    -KKLSARA

Similar Threads

  1. 2015: Using Room Separtors and Room Schedule Showing Area Not Placed
    By Thayana in forum Revit Architecture - General
    Replies: 1
    Last Post: 2014-11-12, 07:38 AM
  2. Create Room Tag Room Number
    By imiller.203205 in forum Revit Architecture - General
    Replies: 2
    Last Post: 2010-08-04, 06:35 PM
  3. Replies: 2
    Last Post: 2008-11-03, 02:24 PM
  4. room number will not show up on room tag
    By jordannw in forum Revit Architecture - General
    Replies: 4
    Last Post: 2007-12-28, 05:41 PM
  5. a room tag that will show "room length x room width"
    By bayejid_bd in forum Revit Architecture - General
    Replies: 6
    Last Post: 2006-02-06, 08:48 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •