Quantcast
Channel: All Revit API Forum posts
Viewing all articles
Browse latest Browse all 66835

Re: Room Name Problem

$
0
0

Hi  ,

In your code,what is RefStringToString?

Here is the complete code to get your element's Room name.

 

 Element e;
                LocationPoint LP = e.Location as LocationPoint;
                XYZ FurniturePoint = LP.Point as XYZ;
                Room room = doc.GetRoomAtPoint(FurniturePoint);
                if(room!=null)
                {
                    string roomName = room.Name;
                    TaskDialog.Show("Room Name", roomName);
                }

I still don't know why room.name is showing an error.

 

i thik the problem may be with the filteredelementcollector.

FilteredElementCollector ^collector = gcnew FilteredElementCollector(doc); 

when you use this code it won't collect anything.

 

If you want to collect the familyinstances then use the below code.

FilteredElementCollector Collector = new FilteredElementCollector(doc).OfClass(typeof(FamilyInstance)).WhereElementIsNotElementType();

my suggestion is start a new project and type your code.(don't copy paste anything)

 


Viewing all articles
Browse latest Browse all 66835

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>