I have a problem in changing the dimension of the cuboid which is created by bounding boxes (Min. and Max point). When I try to scale the cuboid for door element, all of the surfaces of solid boxes are scaled. but I’m looking for making the cuboid parametrically change in width and length. I tried to slice the surface of cuboid and then offset it but it doesn’t work. Any Suggestion?
Assuming you want it to be centred from the same point, use Solid.Centroid, the create a new cuboid at that point using Cuboid.ByLengths (with origin input). You can translate it by half of whichever dimension you need it offset by if you need it to be based on centre bottom etc.
Actually I tried to create the new cuboid based on the cuboid.Length but when I want to change the width and lenght or height the new cuboid is not created from in front of the door. as you see on screen shots, the second cuboid is not created from front of the door. I don’t know what’s my problem.
Another problem that I have is I want to make it is changed parametrically when I change the width and height of the door. but it doesn’t work.
Please see the screen shots of my model.
It appears you are using the bounding box of the door, so this will not be from the front of the door. Maybe as an alternative, try the following logic:
- Get the door location (point)
- Get the host wall thickness
- Get the host wall rotation
- Offset the door location by half the thickness, perpendicular to the rotation angle
At that point you should have a point at the front of the door
- From there, move that point half of the cuboid depth further from the front (or you can do this via a sum in the original step to do one movement)
- Move it up by half of the height of the cuboid to be made
- Create a cuboid at that point with desired dimensions
- Rotate the cuboid by the wall rotation angle compared to the Y axis (it will be in Dynamo north)
I assume you are doing latchside clearance here. As an alternative, consider building this as a nested family into your doors.
Thanks! I tried your solution but I received the null out put on retrieving the host wall rotation. And also I couldn’t offset the door location, because all node that I used I received and error.
Plz check it as bellow:
I’d go about it in 1 of 2 ways, see below. Using family rotation is probably superior as the wall direction depends on the draw direction which isn’t related to the door itself.
Options.dyn (34.2 KB)
Thank you so much, It works and I could get the point at the front of the door !!
But the another problem is still remained that when I move the point base don the height and width of the door to create the cuboid, again the cuboid has been created lower than the origin point ( At front of the door). I want to create the clearance zone not lower than the level of the door.! See the following screen shots.
Beside, Another point that, for rotate the cuboid by the wall rotation angle compared to the Y axis, I receive an error that I don’t know how can I set the cuboid rotate based on the wall orientation.
Don’t use the wall.orientation node, just use the families rotation given it is in the wall, then use that to rotate the bounding box.
You will need to find the point halfway up the height of the box, and halfway away from the wall to place the box at that point, then rotate around that point.
I’ve built it for you, as it looks like you’re not quite sure which nodes to be using here. From here the rest is mathematics based on the door parameters I think.
bounding boxes.dyn (34.0 KB)
Thank you so much. It is solved and it’s working.
There’s a node of springs package to scale in X,Y,Z a bounding box, I think it would work as well