Hi,
I tried to use the PostCommand function to call the built-in Revit command "CreateTemplateFromCurrentView".
View active_view = ui_document.ActiveView;
ui_document.ActiveView = copied_views.First();
using (Transaction t = new Transaction(document, "Create template from view"))
{
t.Start();
RevitCommandId id = RevitCommandId.LookupPostableCommandId(PostableCommand.CreateTemplateFromCurrentView);
ui_document.Application.PostCommand(id);
t.Commit();
}
ui_document.ActiveView = active_view;
The trouble is this piece of code is called more than once during my command execution, and you can post command only one Revit command.
Is there a way to call this Revit command with arguments (here typically, the name of the created view template) and execute it silently ?
Or is is something you plan to allow ?
Thanks.
Maxime