Mirror node for Family instances

I’m looking for a mirror node, that will take given family instance and mirror it about a given axis. Ideally it could work with list of instances and list of axis (2 In ports).

 

I’m trying to place a new family instance to match other instance. I can get location and rotation working ok, but mirror and flip are a bit more challenging. Thanks.

There are no default nodes for that, unfortunately. You’ll need to access the API. The correct call for mirroring is “ElementTransformUtils.MirrorElement(s)” :

http://revitapisearch.com/html/36027166-d494-9937-74c2-d61197af3878.htm

 

I don’t really know how to convert those C# and VB examples to Python, here is my first attempt so far (it doesn’t work):

python

Hi Luke,

You’re pretty close. The last thing to do is convert Dynamo’s planes to Revit planes. I thought we can do that with the built in “.ToRevitType()” method but it seems we can’t. We can write our own little conversion function instead:

2015-05-06_15-05-41

The only problem with the above code is that we can’t wrap the newly created mirrored elements because the Revit function doesn’t expose them. Therefore every time you execute the dynamo graph, you’ll have new elements overlapping the old ones.

You can get some more info on Dynamo’s built in conversion methods in the below link:

Brilliant! Thanks for the solution, and for the lesson on how to bring import these utils and implement. You commented code is much appreciated. I can just make a selection set of the old objects, and then delete after running. Thanks again Dimitar!

mirror

I have published a version of this as a node that uses Clockwork to get the ‘normal’ vector of the families and generate a plane based on the element itself. I’m sure there may be complications, but it is working for me!

Hey Luke , is it possible to share the solution , i also have the same problem and would like to know more about the solution

Check the bakery package. There was also another discussion recently around mirroring which may be of use.

yes i checked it and tried it but it didn’t work even for one model selection although its the new version of Bakery i couldn’t discover where is the problem is

Wait - you’re back to mirroring the family after making the instances instead of making both sets at once?

@hamzeh_ahmad_1989 are you able to Mirror inside Revit environment? Is your family Work Plane Based?

?

1 Like

Hey kulkul, yes it is a work plan based, this is exactly what I was looking for, could you please tell me more about the pythonscript that you used?

i am just trying to mirror the desk at multiple points in a rectangle room
here is the result that i have so far , i tried to use family point by instance on a curve and reverse but it went wrong because of the family location point
15.09.2019.dyn (98.1 KB)

maybe your solution with the pythonscript is better so i hadnt to chande the family point location every time as in the shown photo

yes because i wanted to mirror the rotating objects of the family instance , could you explain more what you mean exactly ?

I dropped the script in below post. For further discussion use below post. This topic is already solved, we can’t have many solution in one topic.

Cheers!

1 Like