Identifying Identical Layouts of Elements

Identifying Identical Layouts of Elements

drewj
Enthusiast Enthusiast
231 Views
1 Reply
Message 1 of 2

Identifying Identical Layouts of Elements

drewj
Enthusiast
Enthusiast

I am looking for some guidance on logic for a challenge I have.

 

I need to identify identical sets of furniture elements in a model, so that I can copy data from one "typical" element to the others. For example, there are 6 desks laid out in a 2x3 grid and I need to find all other identical layouts of the same 6 families in the model.

 

So far I have used uidoc.Selection.PickObjects to have the user select the "typical" familyinstances, then I have recorded the location of 1 of the familyinstances along with the relative location of each of the other familyinstances to this 1st one. which I think will give me a layout that I am trying to find repeated.

 

My thinking is that I will next iterate through the model looking for familyinstances that exist in the same layout, so I have collected them in a filteredelementcollector and started looking at their relative location from one another... and now I am thinking that my logic at present is gonna result in a lot of data that needs to be processed, so there must be a more efficient way to approach this...

 

Any better ideas would be appreciated. I don't need exact code, just to be pointed in the right direction.

0 Likes
232 Views
1 Reply
Reply (1)
Message 2 of 2

RPTHOMAS108
Mentor
Mentor

Seems like an easy task but is one of those which isn't depending on spacing between arrangements of furniture. A sensible modeller would have been using groups for these repetitions but I take it that isn't the case.

 

The hard part is that you need a criteria where you decide how to cluster the instances together as an arrangement.

Say you take a chair at the edge of such a grouping it may be nearer to another grouping centre than the one a human has the ability to recognises it is actually part of.

 

As an example Revit doesn't distinguish tables and chairs (they are all FamilyInstances) but humans know that one common arrangement is for tables to be the centre point for a set of chairs. So you know for that arrangement you have a cluster of points and each of those points is associated with a type. There will be one type in the cluster repeated a lot of times (chairs) and one or two in the centre of those (tables). A second form of arrangement is where one table is paired with one or two chairs to one side (lecture environment etc.). FamilyInstances also have a FacingOrientation property so that will also allow you to understand if a set of FamilyInstances are pointing towards a centre of a group.

 

Probably you can also separate out by room boundaries etc.

 

Once you have your clusters it is just a case of ordering the location geometry and type info so that they are compared with other groups consistently to identify them as the same or not. In terms of geometry perhaps you create a local system based on the direction of the central instance etc. (you then have to deal with lines of symmetry for that).

 

I don't know if any of that helps it is just my abstract thinking on the subject. Most of the starting points are going to involve filtering for all the instances so they can be compared. You could start level by level and room by room to limit the initial data sets.

0 Likes