Here is a question raised and answered by my colleagues Katsuaki Takamizawa and Phil Xia on creating and editing a slab. Some related topics that we already discussed are related to the analysis of the geometry of existing slabs, e.g. the slab boundary and its side faces, explorations of the geometry of other elements, the eave cut property of roof slabs, and how to edit a floor profile. Now let's look at this generic slab issue:
Question: In the user interface, we can use the shape editing tools to modify slab surfaces and to create non-rectangular slabs. Is it possible to create slabs like these through the API as well?
Also, can we define slope angles on these non-rectangular slabs?
Answer: You can modify the slab surface with the slab editor, accessible through the SlabShapeEditor property on the Floor class. The SDK sample SlabShapeEditing shows how to use it.
There is no way to modify the slope of an existing slab, but it can be specified when a new slab is created with NewSlab method:
public Floor NewSlab( CurveArray profile, Level level, Line slopedArrow, double slope, bool isStructural )The parameters are:
- profile: an array of planar lines and arcs that represent the horizontal profile of the slab.
- level: the level on which the slab is to be placed.
- slopedArrow: a line to control the sloped angle of the slab. It should be in the same face as the profile.
- slope: defines the slope.
- isStructural: specifies whether the slab is structural.
Many thanks to Phil and Katsu-san for this overview!
When constructing a slab, how can I specify openings? Obviously just appending them to the passed CurveArray doesn't produce the desired effect and I can't figure out how to add them after-the-fact. Any thoughts?
Posted by: Mike King | February 15, 2010 at 14:32
Dear Mike,
Sorry for the belated answer, I just returned from a vacation.
Actually, I believe there are two ways of creating openings.
One possibility is to use the Document.NewOpening method to create openings in an existing host element.
The second may indeed be to append additional loops to the passed-in curve array directly when creating the host object, as you can see from the comment by Ning on creating walls with openings, even though he points out that it is not always working reliably in his case:
http://thebuildingcoder.typepad.com/blog/2009/02/creating-a-wall-with-a-sloped-profile.html?cid=6a00e553e1689788330120a6cd4ccf970b#comment-6a00e553e1689788330120a6cd4ccf970b
I presented some code to generate a slab in
http://thebuildingcoder.typepad.com/blog/2008/11/editing-a-floor-profile.html
The additional edge loops in the existing slab are intentionally eliminated in that code. You might be able to modify it to leave them in and thus create the required openings at the same time as the slab itself. I should add that I did attempt to do this myself and was unable to get it to work as expected. Although Ning seems to have used it to create walls with openings, it may not work for floors.
Cheers, Jeremy.
Posted by: Jeremy Tammik | March 01, 2010 at 11:13