Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Place Model Group Postable Command

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
mastjaso
657 Views, 3 Replies

Place Model Group Postable Command

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?

3 REPLIES 3
Message 2 of 4
aignatovich
in reply to: mastjaso

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.

 

Message 3 of 4
JimJia
in reply to: aignatovich

Great answerHeart, thanks a lot for your sharing and help!Heart

 

 


Jim Jia
Autodesk Forge Evangelist
https://forge.autodesk.com
Developer Technical Services
Autodesk Developer Network
Email: Jim.Jia@autodesk.com
Message 4 of 4
mastjaso
in reply to: JimJia

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.

Post to forums  

Autodesk Design & Make Report