New script: cutting windows/doors
-
Hi all,
Here is my attempt to ease the creation of openings in double-sided walls.
Reveals are not "linked" to the cutting components for now but I guess it can be of some interest as is.
And remember: try to kill it to find the bugs
http://www.sketchucation.com/forums/scf/viewtopic.php?f=153&t=3848Regards,
-
Well done Didier. A relatively painless way to give any cutting component some attributes so that it will punch a hole of the desired shape through a twin skinned wall - but only if you want it to...
I see that you have ### disabled the observers (CuttingWindowWatch) till you get your head around them. They will need to be convoluted.
To get the observers to work you'll need to attach themselves to each of the component instances as they cut the hole, AND also auto-load them in later sessions at startup to get them to continue to 'report' on those components as they change... Note how you need to add an observer to each instance [NOT the component's definition] for them to be useful later...
You also need to add similar observers to all of the faces forming the reveal of the hole that the instance cuts.
The hole's faces AND the matching instance all need to have a unique random-number attribute ID to tie them together - set at the moment the hole is cut.
Later on, if an observer spots that the instance is moving it reads the transformation (you might need to remember the 'at rest' transformation when these attribs are first set and save that as an attribute too ?) The initial 'at rest' attrib can be read and updated to suit. A dialog could then ask if you want to keep this window and its hole linked together. If 'No' then their linking attributes and observers can be deleted: if 'Yes' then the associated faces with the same ID move by the same amount. Also these faces' transformations are also storable and can be updated to suit. This way you can choose to keep them linked and move together.
You would also need an observer to spot them being copied so that the linking attribute IDs are either eased from the copies OR replaced with new unique IDs. If any one of the linked faces or the window instance are deleted then all of the remaining observers and attributes also need clearing from what's remaining - perhaps with a warning messing ?
Scaling of the window should alos be reflected in rescaled reveal faces when the link is kept ?
If a face of the hole moves then the other faces and the associated window should move with it IF they are to be kept linked...
This linking by attributes and observers is like a weak grouping that lets you change some things that affect others as you work...
Advertisement