Placing a library part using the Revit Api
I am usin开发者_开发百科g the Revit API to import a family symbol. The code below is working though it loads the family into Revit and then you have to manually drag it from the families tree or insert using the relevant family tool.
Document document = commandData.Application.ActiveDocument;
document.LoadFamilySymbol(fileName, name, out gotSymbol);
How do I get it to the point where it is asking the user where they want it placed? (similar to when you click "load into project" when you are editing a family) so they don't have to drag it from the families tree.
The UIDocument class has a method called 'PromptForFamilyInstancePlacement' which accepts the symbol. Give that a go.
精彩评论