Flip Facing Without Showing the Arrow

Flip Facing Without Showing the Arrow

smharch
Advocate Advocate
804 Views
5 Replies
Message 1 of 6

Flip Facing Without Showing the Arrow

smharch
Advocate
Advocate

Hello all, 
I think the answer is no but I want to ask. Is there a way to use flipFacing Method without allowing the user to see or click on the blue arrows? I want to control the facing side of a family through code but disallow someone from manually flipping this one particular family. 

 

I have checked the CanFlipFacing Property but until I place the blue arrow it remains false preventing flipFacing Method from exicuting.

 

Thank you for any help you are able to provide,

Steven

0 Likes
805 Views
5 Replies
Replies (5)
Message 2 of 6

naveen.kumar.t
Autodesk Support
Autodesk Support

Hi @smharch ,

Is it possible via Revit UI?

If it is possible via UI then through Revit API also you can achieve this.

From my understanding, it is not possible. 

The other ways could be you can pin or lock the element.

 

 


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 3 of 6

Anonymous
Not applicable

Thank you for your reply Naveen,

 

I am trying to write a plugin for my firm and want to flip a family to the other side of the host. When I try to do this nothing happens because the family is not flappable. How can I enable CanFlipFacing Property without placing the blue arrows in the family? To my knowledge until CanFlipFacing Property is set to true the flipFacing Method will not work.

0 Likes
Message 4 of 6

naveen.kumar.t
Autodesk Support
Autodesk Support

Hi @Anonymous ,

What type of family instance do you want to flip?

If the family instances are doors or windows then FamilyInstance.CanFlipFacing is true so you can flip face using FamilyInstance.FlipFacing();

FamilyInstance fi ;
if(fi.CanFlipFacing)//Checks whether the familyinstance can be flippable
 {
   fi.flipFacing();//flips the familyinstance
 }

First Check whether the element is flippable via UI?


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 5 of 6

FAIR59
Advisor
Advisor

You can program the flip yourself:

		FamilyInstance inst = doc.GetElement(sel.GetElementIds().FirstOrDefault()) as FamilyInstance;
		XYZ normal = inst.FacingOrientation;
		XYZ origin = (inst.Location as LocationPoint).Point;
		Plane pl = Plane.CreateByNormalAndOrigin(normal, origin);
		using (Transaction t = new Transaction(doc,"flip instance"))
		{
			t.Start();
			ElementTransformUtils.MirrorElements(doc, new List<ElementId>() { inst.Id}, pl,false);
			t.Commit();
 		}
0 Likes
Message 6 of 6

Anonymous
Not applicable

Thank you both for your reply. I am trying to flip a face based specialty equipment. I chose not to mirror it because I do not want to create a new element. The families GUID is tied to a door (so if the door moves the script will move it with the door). 

 

Naveen, 

In your example, you are checking CanFlipFacing but the only way I know of to have this set to true is placing the blue arrows allowing any user to flip the facing at any time. I am wondering if there is a way to set this to true without the blue arrows. 

 

Thank you for your replys, 

Steven

0 Likes