I'm trying to load a WallType from another .rvt file, and prompt the user to place the wall wherever they want. Jeremy Tammik describes how to Transfer a Wall Type from another .rvt file. However, I still can't figure out how to prompt the user to place said new WallType. It should behave in the same way that uiDoc.PromptForFamilyInstancePlacement() functions. Anybody have any ideas?
I suppose I could use the Wall.Create() method. Then, I need a way to prompt the user to draw the Curve that defines the wall. So, the only way I can figure out how to do that is to use the Selection.PickPoint() twice, then use the two defined points to create a straight curve to make a straight wall.
There, unfortunately, seems like no way to mimic the native Revit UI behavior of creating a wall from scratch. Or am I missing something here?
Hi!
To promt the user to create a Wall you can use PostCommand:
uiapp.PostCommand(
RevitCommandId.LookupPostableCommandId(PostableCommand.ArchitecturalWall)
);
To make sure that the right WallType is selected when you call it, a workaround is needed. One that comes to mind is to open a transaction before calling PostCommand, create a wall using the Wall.Create method with the desired WallType, close the transaction and delete created wall using doc.Delete(). After that, when PostCommand is called, the desired wall type will be selected by default. Maybe there are other ways to make it.
Nice! I felt there was some kind of setting that was responsible for this. I just couldn't find it. 😃
Can't find what you're looking for? Ask the community or share your knowledge.