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)