Option to programatically select Mirror Axis after MirrorProject postable command

Option to programatically select Mirror Axis after MirrorProject postable command

Rahul.Khande
Enthusiast Enthusiast
842 Views
4 Replies
Message 1 of 5

Option to programatically select Mirror Axis after MirrorProject postable command

Rahul.Khande
Enthusiast
Enthusiast

Hello Team,

 

We are using MirrorProject postable command to mirror the entire project using our addin. Mirroring the project happens in batch.

But after executing MirrorProject command, dialog is displayed to select mirror axis. So question is:

1. Is there any way to select mirror axis by api instead of showing dialog?

2. Or is there any better way to mirror entire project in one go?

 

Thank you.

0 Likes
843 Views
4 Replies
Replies (4)
Message 2 of 5

jeremytammik
Autodesk
Autodesk

I can answer item 1 offhand: no, sorry, no way. PostCommand just launches the original built-in Revit command with its standard end user interface and no possibility to pass in options programmatically.

 

For item 2, the Revit API does provide a few transformation and mirroring options that may fit your needs. For instance, take a look at the methods provided by the ElementTransformUtils class:

 

https://www.revitapidocs.com/2020/82e737d5-fda4-bc10-6099-88999cd51300.htm

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 3 of 5

Rahul.Khande
Enthusiast
Enthusiast

Thank you for your quick response. I will try it and let you know.

0 Likes
Message 4 of 5

Rahul.Khande
Enthusiast
Enthusiast

@jeremytammik as suggested we tried the approach by using ElementTransformUtils.MirrorElements.

We retrieved the collection of element ids from the revit active document and set plane in which the mirrored model should be placed. We have passed these arguments to the Revit API of mirroring i.e. ElementTransformUtils.MirrorElements(doc, ElementCollection, plane, false);
Mostly it works but facing issue while mirroring the elements with element type of Family Instance.
The family instance are not getting mirrored while all the other types are mirrored as expected.

Any suggestions? 

Thanks a lot. We really appreciate your help.

0 Likes
Message 5 of 5

jeremy_tammik
Alumni
Alumni

Well, you are working with a BIM that is trying to represent a real-world building.

 

You cannot simply mirror a door, for example, since the mirrored version may have a different product number and other vendor specific properties.

 

Maybe you can use the flip operation for those.

 

Basically, however, you cannot mirror a complete house in the real world, so you should expect some challenges trying to do so with the BIM as well.

 

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes