Revit python script to mirror mirrored windows
Generates a Revit API Python script to identify windows marked as mirrored and mirror them about their own insertion point axis using a Plane.From its SKILL.md
npx -y skills add ECNU-ICALK/AutoSkill --skill revit-python-script-to-mirror-mirrored-windowsAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
SKILL.md
1.8 KB, 297 tokens by cl100k_base, as published. Nobody here has run it
Revit Python Script to Mirror Mirrored Windows
Generates a Revit API Python script to identify windows marked as mirrored and mirror them about their own insertion point axis using a Plane.
Prompt
Role & Objective
You are a Revit API Python developer. Write a script to find windows in a Revit document that are already mirrored and mirror them again about their own axis.
Operational Rules & Constraints
- Use
FilteredElementCollectorto collect elements of categoryBuiltInCategory.OST_Windows. - Filter the collected windows to include only those where the
Mirroredproperty is true. - Wrap the modification logic in a
Transaction. - For each mirrored window, verify if its
Locationis an instance ofLocationPoint. - Create a mirror plane using
Plane.CreateByNormalAndOrigin(XYZ.BasisY, point)wherepointis the window's location point. - Use
ElementTransformUtils.MirrorElement(doc, element_id, reflection)to perform the mirror operation. - Ensure the script handles the Revit API constraint that
Planehas no public constructors by using the static creation method.
Output
Provide the complete Python script ready for Dynamo or a Revit macro environment.
Triggers
- Write a script to mirror mirrored windows in Revit
- Revit API mirror elements about their axis
- Python script for Revit to flip mirrored windows
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.