Creating a room
Not applicable
01-27-2015
09:41 AM
Hello everyone.
I am trying to make an app based on "placing a room" functionality.
I have looked at the helpers guide for Revit and found that I just need to add this piece of code to get started:
Room CreateRoom(Autodesk.Revit.DB.Document document, Level level) { UV roomLocation = new UV(0, 0); Room room = document.Create.NewRoom(level, roomLocation); if (null == room) { throw new Exception("Create a new room failed."); } return room; }
What I don't get (probably because of my lack of experince in C#) is where I need to implement this piece of code, in order to make it work.
I figured that it was to go into my public class Command : IExernalCommand, but there I do not know how to trigger it, becuase the program only executes what is inside the public Result Execute, where I can't place the piece of code (or what it seems).
Can somebody please tell me how to trigger the piece of code, I have searched and worked on it for two days now.
Any help is highly appreciated!
Link copied