How to add a parameter that sees the flip/mirror Function in door and window families

How to add a parameter that sees the flip/mirror Function in door and window families

MHarrisFR822
Contributor Contributor
2,201 Views
12 Replies
Message 1 of 13

How to add a parameter that sees the flip/mirror Function in door and window families

MHarrisFR822
Contributor
Contributor

I am trying to add a parameter in the door and window families that sees the flip/mirror function.   I am needing to change the tag on some doors if they are mirrored.   For example a Sliding door looking from the exterior would be tagged 8080 SL XO  or 8080 SL OX.  The "OX" represents which door is operable and which is fixed.    After I can figure out how to add the parameter the Tag part is easy.    

thank you for your help

0 Likes
2,202 Views
12 Replies
Replies (12)
Message 2 of 13

SteveKStafford
Mentor
Mentor

I wrote a blog post years ago about using the Autodesk Model Checker application to "see" that setting for casework. That's not visible to us in the Revit UI but it is to programming via Dynamo or other. So I'd take a look at the Dynamo side of this to "find" and then decide how to make you/others aware of the fact that they've been flipped etc.


Steve Stafford
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
EESignature

0 Likes
Message 3 of 13

barthbradley
Consultant
Consultant

Share and nest the family. Then you can tag nested family in Project. 

 

oops...another speed reading accident.  he, he.  

 

0 Likes
Message 4 of 13

MHarrisFR822
Contributor
Contributor

I have seen another blog that did what you are describing.   The process turned the mirror items red.   What I am looking for is to set a parameter to the flip/mirror button.   Some doors when mirrored will have a different tag.   I will add an Id parameter and set up an if then statement.   If normal tag XX, if Mirrored tag XY. 

0 Likes
Message 5 of 13

SteveKStafford
Mentor
Mentor

Should be doable via Dynamo. High level summary of steps: search categories, look for parameter value, set your parameter value, then place correct tag. After Dynamo runs, adjust tags for legibility. I'm sure you can find examples of Dynamo stuff that does essentially the same steps...just looking for different stuff/results. IRCC there are different flip/mirror states to consider, there is a difference (code wise) between mirrored with the mirror tool and flipped with a family flip control.


Steve Stafford
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
EESignature

0 Likes
Message 6 of 13

MHarrisFR822
Contributor
Contributor

Maybe its the flip tool I am looking for that mirrors the door.    On a normal door it would flip the swing to the opposite side. 

0 Likes
Message 7 of 13

MHarrisFR822
Contributor
Contributor

lets use a normal interior door as an example.   the door is placed and tagged.  the door tag would say 3080 LH ..  the "LH" is for the door swing.    then the flip tool is pressed and the Tag would change to 3080 RH.    I need to figure out how to associate the parameter to the Flip tool.   

 

0 Likes
Message 8 of 13

barthbradley
Consultant
Consultant

why don't you get rid of the Horizontal Flip and create Types. I mean, isn't that the way they are Manufactured?  

Message 9 of 13

SteveKStafford
Mentor
Mentor

You won't get Revit to just do this without some external action on your part, or your own application that watches for certain actions, or your own application is manually run at milestones or whenever you choose to run it. Via the API it is possible to watch for a user using the mirror tool. I don't know if it is possible to watch for a user using the flip control on a door family and then taking action. For example I've seen apps that warn a user to reconsider doing something the company's prefers they don't do.

 

It's simpler to run an app on the model and look for mirror/flip conditions and then let you decide what to do in response. A watcher is an app that has to run all the time, "looking" at Revit activity so that is inherently more complicated. That means the app has to be well made otherwise it can have a negative impact on the PC's resources and/or Revit performance.


Steve Stafford
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
EESignature

Message 10 of 13

mhiserZFHXS
Advisor
Advisor

As said, you can't do this with OOTB Revit. There is no tool to read when items have been mirrored. You have to use Dynamo or some other tool using the API.

 

It would be nice to be able to associate those flips to yes/no parameters, but there is nothing stopping users from using the actual mirror tool in project to screw everything up. Whatever Autodesk implements, if anything, will require a ton of education on the actual practice side of things.

0 Likes
Message 11 of 13

ralphdenhaan
Collaborator
Collaborator

Hi,

 

I agree with @barthbradley, mirroring isn't the way. But with a simple Dynamo Script, you can check if the element is mirrored or not. When the function returns "True," it indicates that the door is flipped. At this point, you can proceed to add a value to a custom parameter specifically designed to represent the door's flipped status. (Credits to Clockwork package).

import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)

items = UnwrapElement(IN[0])

def IsMirrored(item):
        if hasattr(item, "Mirrored"):
                return item.Mirrored
        else: return False


if isinstance(IN[0], list): OUT = [IsMirrored(x) for x in items]
else: OUT = IsMirrored(items)

 

Select Accept as Solution and Likes are always welcome. 


Ralph den Haan, (Lazy) BIM Specialist


LinkedIn | LazyBIM Blog


 

0 Likes
Message 12 of 13

ToanDN
Consultant
Consultant

There is a thread about reporting door hand using Dynamo.  I shared a sample file and a dynamo script in it. Do a search.

0 Likes
Message 13 of 13

ToanDN
Consultant
Consultant

Before running Dynamo script:

 

ToanDN_0-1689809019588.png

 

 

Running dynamo script:

 

ToanDN_1-1689809044247.png

 

Result:

 

ToanDN_2-1689809098228.png

 

0 Likes