Move Group Origin

Move Group Origin

Anonymous
Not applicable
12,954 Views
12 Replies
Message 1 of 13

Move Group Origin

Anonymous
Not applicable

I need to make some changes to groups, so I am going the route of ungrouping, regrouping, and changing types. Unfortunately, this leads to some group origins being moved from their original group location. Is there any way to set where the group origin is by the Revit API? I'm don't want to move the groups, just their origin point as you can in the UI.

 

I've seen these threads from 2015 & 2016, but I wasn't sure if this functionality was added tot he API or not:

 

https://forums.autodesk.com/t5/revit-api-forum/group-origin-please-add-api-to-get-amp-set/m-p/596682...

https://forums.autodesk.com/t5/revit-api-forum/set-xyz-point-for-model-group/m-p/6331903

 

Does anyone have a good workaround for doing this if it is not a API functionality?

 

Thanks!

 

 

Accepted solutions (1)
12,955 Views
12 Replies
Replies (12)
Message 2 of 13

jeremytammik
Autodesk
Autodesk
Accepted solution

Dear Dan,

 

Thank you for your query.

 

I have not seen any update on this issue.

 

I added a note of your request to the existing wish list item CF-3797 [API wish: ability to set origin point of group but not change location of the group itself -- 11368136, 12098587, 14362024].

 

Have you also checked for a corresponding wish list item in the Revit Idea Station, as suggested in one of the threads?

 

That is currently the strongest driver for developer requested API enhancements.

 

The weird thing is that you can apparently change the group origin manually in the UI:

 

 

Nowadays, in Revit, all manual functionality is always automatically equipped with a corresponding API access.

 

Unfortunately, the group functionality has not been updated for a while and apparently still lacks that access.

 

I hope this helps.

 

Best regards,

 

Jeremy

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 3 of 13

Anonymous
Not applicable

Thanks, Jeremy.

 

I wasn't sure if I was just missing the feature or if it hadn't been added. I appreciate the response!

0 Likes
Message 4 of 13

techY7D3N
Explorer
Explorer

Is there any update on this topic ? 

 

Message 5 of 13

pieterschiettecatte
Advisor
Advisor

I would also love a resolution for this. 

Message 6 of 13

baleti3266
Advocate
Advocate

whats with revit api and group instances? it seems to be completely nerfed. no way to get transformation, no way to enumerate excluded instances?

0 Likes
Message 7 of 13

rcrdzmmrmnn
Advocate
Advocate

You could post command for restoring all excluded instances(ID_RESTORE_ALL_EXCLUDED), check for elements added, then rollback the transaction or whatever

0 Likes
Message 8 of 13

baleti3266
Advocate
Advocate

the problem this creates is that you cannot do anything after post command is invoked. You have to rely on the user to follow it up with corresponding command afterwards, which effectively breaks your code

0 Likes
Message 9 of 13

rcrdzmmrmnn
Advocate
Advocate

I don't quite understand what you mean by "you cannot do anything after post command is invoked"
I can't try this right now but I assume you can:
1-Run an external command.
2- In this external command, subscribe to DocumentChanged event(Or an updater if you wanna do something with the elements)
3-Invoke the PostCommand method
4- Analyze the DocumentChangedEventArgs.GetAddedElementIds() method

This is where I'd start, but without understanding the needing requirements, it's just a guess

0 Likes
Message 10 of 13

baleti3266
Advocate
Advocate

oh sorry I see what you mean now, hmm I've seen Jeremy's blog post about it and although I never got it to work I can see how this can be a viable solution to chain commands and addin code

I'm actually curious if it is possible to register a rollback transaction after a DocumentChanged event - this sounds like a quite powerful technique in general

0 Likes
Message 11 of 13

rcrdzmmrmnn
Advocate
Advocate

Well, I don’t think you can. I believe that when the DocumentChanged event fires, the change has already occurred, since it’s a read-only event.
But, as I mentioned, you can achieve similar results with an IUpdater — in that case you should be able to roll back the transaction (I think). And even if you couldn’t roll it back, you’d still have the element IDs and could delete them yourself.

In fact, I have an ExternalCommand that posts the command of ModelLine, then subscribes to an Updater. Inside that updater I “listen” for the new ModelLine and also subscribe the Idling event, make further changes, and then unsubscribe. So this kind of chaining is definitely possible.

If you want to discuss further, you might consider starting a new post—this one’s already drifting beyond the scope of the original question.

Message 12 of 13

baleti3266
Advocate
Advocate

fair enough, yeah this looks like a really powerful technique, I will have a look at it and post it separately later

Message 13 of 13

jazzsharma200
Advocate
Advocate

any update to change group origin in 2026?

0 Likes