(c# 2019)I don't know the plane, the parameter of the function for ElementTransformUtils.MirrorElement

(c# 2019)I don't know the plane, the parameter of the function for ElementTransformUtils.MirrorElement

klkl12234
Advocate Advocate
241 Views
1 Reply
Message 1 of 2

(c# 2019)I don't know the plane, the parameter of the function for ElementTransformUtils.MirrorElement

klkl12234
Advocate
Advocate

Hello, I am using the Revit 2019 version, and the net version of c# is 4.7.

In the plane, Create, CreateByNormalAndOrigin, CreateByOriginAndBasis, CreateByThreePoints all tried but failed.

 

There are ducts called A and B Duct ducts that are attached to each other, and A is on the left and B is on the right.
If you do Mirror-Pick Axis on the tab "Modify|Ducts", you can move B to the left based on A. I want to make that function, but I don't know what to do with Plane.
I can't attach the picture because of the company's security. Please understand.

 

I want to make it like a chair on the link below.

https://forums.autodesk.com/t5/revit-api-forum/elementtransformutils-mirrorelements-with-xy-plane/td...

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

RPTHOMAS108
Mentor
Mentor

You want to use the XZ plane? You are in plan or section?

 

Your mirror line in the UI represents a plane (in section). Easiest way to create a plane is by origin and normal (origin = any point on your line, normal = vector perpendicular to your line direction.

 

You can either calculate the normal vector or use Curve.CreateTransformed and get the direction from the rotated line or Tranform.OfVector on the mirror line direction. For both those functions you would need to input Transform.CreateRotation specifying a rotation axis and angle in radians, if you are rotating in plan can use XYZ.BasisZ for the axis (rotation required would be pi/2).

 

A plan picture of two rectangles, mirror line and a coordinate axis isn't going to be an issue for anyone.

0 Likes