Family Mirror using Python and API

Hello All,
I tried to mirror Family type by Geometry. Mirror and it worked but the problem was that the Mirrored objects are only dynamo objects and cant be converted to Revit objects, my question is I want to mirror these desks at the other side of the Planes by using API and Python ??
I am very appreciated for any help

Why? You’re placing the other families in this graph, and geometry conversion is far and away the slowest aspect of Dynamo.

Just place the families for both sets of points at the same time.


Also, it’s likely going to be a lot easier to track this stuff when you get into off axis geometry if you use a coordinate system to track where stuff is instead of points. This adds the ‘facing direction’ to the object in the form of the coordinate system’s X axis (or Y axis - however you have your families and graphs set up).

Thanks, Jacob for your answer, you are right about the Element geometry node, it’s my fault, I duplicated the points according to a python script aslo you are right about it but I don’t know now how to do it now for the set points that I have i can explain it later , but now the main issue is I would like to have the desks perpendicular to the X-Axis in one case and another case to the Y-Axis as shown in the small script below so also the mirrored object should follow this as well, maybe there is another easier solution to replace it but this is what I got until now , so what do you think ?

Post the full dyn and everything needed to run your graph as is (ie: the Revit file) and I’ll try and have a look tomorrow.

I see you removed the post where shared the .dyn so myself and potentially others can help. This was on my list of stuff to look into today. Going shopping now instead - if it’s back up then perhaps I’ll have a look tomorrow.

Generally speaking his forum requires the history of posts to be maintained, otherwise instead of helping all users by allowing them to learn from how your work progressed we are only helping you today.

Hey Jacob no I am just updating the python code of course this forum to Share and learn from each other I am uploading it again, sorry for the misunderstanding I should told about it, i can also upload the old one again .

I think I found the solution but it needs to change the location family point to the middle, then to have two family instance by point one depending on curve and reverse curve, what I am gonna upload it here

15.09.2019.dyn (98.1 KB)

Hi @hamzeh_ahmad_1989

Here is the script Mirror(ForHamzeh).dyn (11.0 KB)

Thanks KulKul , still didn’t work for me , i am gonna explain it , there are 3 python script , the first one for duplicating points in the room , second one for changing of degree ( rotating family )to be always perpendicular to the maximum length edge , third rotating the mirror also to follow the rotating degree for family and be perpendicular to the maximum length edge

Mirror%20python

So I couldn’t get your file to work - looked like a units issue, but the lack of comments in the python nodes meant I was spending too much time guessing at what each aspect was doing to make any headway on it. :frowning:

I did put this little graph together to make instances using coordinate systems.

Idea is to not just track the point, but track the orientation at the same time. if you know what corner of the ‘desk’ is the insertion point, you can set this up to layout any pattern you want.

The Revit file is a basic (and I mean BASIC) file consisting of pretty much nothing but the family I am placing. Even though this is so simple I am including it as stuff like units and family name matter for reverse engineering stuff like this.

Base File.rvt (1.4 MB)

I could (ok should) have pulled the dimensions of the desks from the desk family itself - next time out I guess. :slight_smile:

Anyway, here is the .dyn - hopefully it helps you learn.

Family Instance by Coordinate System.dyn (78.5 KB)

1 Like

@JacobSmall , thank you so much i think to track the orientation is very important , but of course i should take in considerations the the origin point of the desk , i am gonna check it out , i couldn’t open the revit file

i tried only to duplicate the point according to the width, length and clearance of the desk , i uploaded the Dynamo file which has the python script last time you can find it above and the revit file its just a rectangle room with a door 15.09.2019.dyn

Revit 2020 is likely required, but the dyn should work as far back as 2017. Start a new rvt file from the en-us architecture template.

I started three files and drew a rectangle of walls and dropped in a room, none of which worked. First used an en-us template, and the desk counts were absurd and they overlapped so I though maybe it was metric. Next was from a metric template, changed to M and no desks drew - apparently your python required a minimum and maximum room dimension. The final one contained the right size room - well I thought it did. Soon I found a few rows of desks being placed well outside the walls. After this time I gave up and said ‘this doesn’t fit any file I can create, lemme see if I can demonstrate on my own.