Is it possible to retrieve Group rotation?

Good mornign all,
is it possible to get the rotation of a Detil Group (to later be replaced with a Family)


Short answer, no as groups have no coordinate information. Long answer is yes with a but; you can use one of the elements in the group to determine the orientation of the group, but this involves:

  1. Inclusion of an element which is orthogonal to the group extents so you can determine its rotation relative to one of the global axes
  2. Modifying said element, but this is not possible without un-grouping. One way to circumvent this limitation is to open a sub-transaction, un-group, get the target element, establish its orientation (by getting its boundary curves and using its vectors to measure the angle from the global X-axis for example), then unroll the sub-transaction which ‘undoes’ the un-group action

Either way its an imperfect art.

I’m using the Group.Members (from Clokwork) to get an element but it’s tricky since that element can be… anything :wink:

So yes, it’s an art :slight_smile:

Still no functionality in Revit to retrieve rotation of groups.
An idea is to make a dummy-group.
Start transaction
Mak a dummy-group and add an modelline to the group.
Replace the orignal group with the dummy group.
Get the rotation of the modelline
unroll the transaction
This might be (slightly) faster then the current Solution.