Is there a postable command for Placing a Model Group? I can see the one for creating a new model group, and for placing a detail group, and I can set the default ModelGroupType using document.SetDefaultElementTypeId(ElementTypeGroup.ModelGroupType, id) , but I can't seem to find the postable command for actually placing a model group into a project, am I missing something obvious or is this another item for the api wishlist?
Solved! Go to Solution.
Solved by aignatovich. Go to Solution.
Hi!
When you are interested in postable commands and if you don't know command name, the best way is to explore Revit journal file. In this case it will be something like this:
... 'H 01-Aug-2018 10:42:38.717; 0:< Jrn.Data "Restricted Propagation" _ , 2, 71 ' 0:< <<Begin build CT>> ' 'Edit mode: IDR_COMMON 'Command: ID_OBJECTS_PLACE_GROUP 'Category: 0 'Bar list: ' Dialog_Revit_DynamicLabelDBar ' Dialog_Revit_FamilyBar ' Dialog_Essentials_MoveProps ...
So command id will be ID_OBJECTS_PLACE_GROUP
Let's get RevitCommandId:
var cmId = RevitCommandId.LookupCommandId("ID_OBJECTS_PLACE_GROUP");
Then we should explore, if the command can be posted (some of them can be posted, some can not)
var canPostCommand = uiApplication.CanPostCommand(cmId);
Unfortunately, in such case canPostCommand is false, and if you try to call:
uiApplication.PostCommand(cmId)
this will fail with ArgumentException. So the answer to your question is no.
Hope, this clarifies.
Great answer, thanks a lot for your sharing and help!
Can you please not mark this as solved? While @aignatovich did provide a great and very helpful answer (which I thank you for!), the conclusion was that this is unsolvable given the current state of the API. Thus this post should remain marked as "unsolved" so that others coming across it don't get the mistaken impression that there's been a solution to the issue.
Can't find what you're looking for? Ask the community or share your knowledge.