Automatically recreates windows/doors at a certain placement using a named constraints and spreadsheets. This is very much a work in progress, it might work for you, it might not. Comments, feedback and pr's are welcome.
This macro iterates over sketches in the openings group and then uses the named constraints to find the openings in a spreadsheet and recreate them. Host object (e.g. the wall) is automatically determined via the external references. It can also be specified in the spreadsheet, link is via the named constraint. The spreadsheet drives things like the template (Fixed window, simple door, whatever your template is named) and all the parameters given; width, heigh, z coordinate, h1,h2 etc - see the sc_openings spreadsheet for details.
Take a look at the window_demo, change the spreadsheet parameters or change the constraint distance and see how the openings move around or change from door to window and so on.
Step by Step to implement:
- Create a group called openings
- Create a group called generated_openings
- Copy the spreadsheet sc_openings from the window_demo file or recreate it.
To use:
- Have a wall based on a sketch.
- Create a new sketch, add the wall sketch as external reference and use a named constraint on a line. The drawing direction is important as the endpoint denotes the start of the opening placement. The direction of the constraint denotes the direction of placement. The length of the constraint doesn't matter, only where the endpoint ends and the direction the sketch line makes. Make sure to toggle construction geometry, as nothing is build on this sketch line. It is just a means to denote a vector and its direction.
- Name the constraint , e.g. 'my_opening_1'
- Add the constraint to the spreadsheet and optionally enter the host object you think this opening belongs to.
- Move the sketch to the openings group
- run the macro
To stop using:
- Move the sketch out of the openings group. This is usefull if you're happy with the generated result or just need to do manual touch ups which you don't want undone.