Quantcast
Channel: All Revit API Forum posts
Viewing all articles
Browse latest Browse all 66672

Re: Create a view template

$
0
0

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


Viewing all articles
Browse latest Browse all 66672

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>