RevitCommandId to open "Assign View Template" window

RevitCommandId to open "Assign View Template" window

Anonymous
Not applicable
974 Views
4 Replies
Message 1 of 5

RevitCommandId to open "Assign View Template" window

Anonymous
Not applicable

Hi everyone,

 

I was hoping that I could open the "Assign View Template" window by passing a PostableCommand enumeration into the RevitCommandId.LookupPostableCommandId() method, but that enumeration does not seem to exist in the API as far as I'm aware.

I have since tested potential ID strings from journal files with the RevitCommandId.LookupCommandId() method, but these strings have only produced null RevitCommandId values or values that seemingly do nothing to the application. 

 

If anyone knows of a better approach to programmatically open the "Assign View Template" window, I would greatly appreciate some advice.  I need to be able to open this window from a button click in my addin.

assignViewTemp1.PNGassignViewTemp2.PNG

Thank you.

0 Likes
975 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable

No way to programmatically open it that I'm aware of. 

 

To find the commandId, you'll need to dig into the Revit journal and find the string for the command.  Just open Revit, click the button, then open the journal in a text editor and see what command it posts. 

0 Likes
Message 3 of 5

Anonymous
Not applicable

I should mention that you want the one from the ribbon, not the properties palette. 

 

which probably doesn't do the thing you want...  You might consider crafting a quick dialog with a list of the available templates and let the user select one, then assign it to the view's ViewTemplateId property.

 

You can try the postable command but I'm guessing it may not work, that's why I'm suggesting the quick winforms dialog route.

Message 4 of 5

Anonymous
Not applicable

Thanks, kmarsh, for the quick response. 

 

I figured that those journal entries (when accessing the window from the properties pallete), were not going to be useful. 

At least I can rest assured that there's no way to open this exact window through the API. 

I'll have to see how the drafters feel about me creating my own form.

 

Thank you.

0 Likes
Message 5 of 5

Alan_Pinho
Collaborator
Collaborator

hello, I know this post is very old, but I also feel the need to have a shortcut key for this function, I would like to know from your experience if it is currently possible to create a command that opens this window. if possible, I'll look for ways to create a macro with this function.

Arquiteto Alan Pinho 

Professional Revit Architecture

Caso sua dúvida tenha sido solucionada por minha resposta, marca este tópico como solução aceita.
Se você gostou da resposta e acredita ser importante, clique em curtir.
Essas ações ajudam a todos na comunidade.
LinkdIn