Help boundingbox


Im new in dynamo and having problem to get my boundingbox to work. I have done a rectangle and a cuboid in the middle of the recangle, you see a little red box in the middle. The goal is to make many of this rectangles with cuboid in my floor (marked blue area). But as you see now, my bounding box is not in line with my floor, which I want it to be.The boundingbox is now a cuboid around my floor. How to solve this? And my other question is how do I get the rectangles that I have done not to go outisde my bounding box?

Thank for helping
/Alice and Ebba

What are you selecting on the Select Model Element node? It’s the floor, or a room? So you want to place the rectangles on the top or on the bottom of the bounding box? It’s not exactly clear on your screenshot what your problem is.

Use BoundingBox.Minpoint or Maxpoint to get the top and bottom points of the bounding box. Use the Point.Z node to get the Z coordinate of the min and max point, use this coordinate as a Z coordinate in your bottom graph, so the elements will be created on this elevation

On select element node Im selecting my floor, which is the blue marked volyme. The floor should imagine a topography, but I have not succeeded to get a topography visible in dynamo jet either… So i work with a floor for now. I want the rectangles to be at the top of my floorbox, like a site plan and dynamo should place the building random at the floorarea (which should be topography later). But I want the rectangles not to go outisde my floorplan, so I need a bounding box? Is it possible?

Thanks for helping!

solve some things but my problem still is that the geometrys (rectangles) is outside my floorplan?

I think you have a misunderstanding what a bounding box is. Bounding box is just a special geometry element, it can’t cut other elements automatically like a section box in revit. You have to use some logic to connect your two graphs.

For using a toposurface, you can use Element.Geometry node, it will convert most revit geometry to dynamo geometry, it works on toposurfaces.

dynamo should place the building random at the floorarea

Maybe calculate the distance of the vertices of the floorarea, place random rectangles on distances smaller than the average distance, use geometry.doesintersect to check if they are really above the floor and filter them.

If you are just learning dynamo this task seems quite hard, I would start with something easier. Find some example scripts which does similar things first, check how they do it, and learn from them!

Also I wouldn’t start with rectangles first, try to place them as points. you can add the rectangles later easily.

I’ll agree with @infeeeee here that there are a few knowledge gaps which you need to fill to execute this task.

Bounding boxes do not rotate under any circumstances. They always align to your X-Y axis.

Curve.Point at parameter or Curve.CoordinateSystemAtParameter could help here, but it would also require a intersection or containment test

A complete run through the Dynamo Primer would help fill these knowledge gaps (and likely others) with some of this stuff. Be sure to skip nothing as you go even if the ‘result’ isn’t something you think you will need - the methods are the important part not the outcome.

What is your end goal? Are you placing random cubes randomly or do you want to do something more specific?

A couple mismatched types you’ll have to fix, but this might be good for you - if you want to make a room or some such with the bounding box, you can use the cuboid edges and draw room separators.

The goal is to eventually be able to run the script in refinery and then for refinery to generate different positions the cube can be placed on within a certain limit. In principle, I would like to be able to generate a situation plan, where different houses will be placed on a plot with the help of refinery.

I have tried to limit the “plot” with the help of points and then used code blocks according to the picture, but it causes problems when the surface is not rectangular.

I have also tried to download different packages such as dynaspace but have not made it work.

Why not use a Surface.CoordinateSystemAtParameter node?