Door Numbering through getRoomAtPoint() Method
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hey Everyone,
I've been trying to make a door numbering add in. My main issue is that the template i'm using doesn't have these doors in the latest phase which causes to_room and from_room to return null. My second approach was to try and use the getRoomAtPoint(Point) method and for some reason it returns a null too! I could really use some help to find the rooms in which the doors belong.
foreach (FamilyInstance door in doorArray) { LocationPoint locationP = door.Location as LocationPoint; XYZ roomP = locationP.Point as XYZ; Room tempRoom = document.GetRoomAtPoint(roomP); using (Transaction t = new Transaction(document, "SetParameter")) { t.Start(); try { door.LookupParameter("Door Number").Set(tempRoom.LookupParameter("Number").AsString()); } catch (Exception ex) { Debug.Print(ex.GetType().ToString() + ": " + ex.Message); }; t.Commit(); } }