Create a square element by size information

Create a square element by size information

Anonymous
Not applicable
722 Views
2 Replies
Message 1 of 3

Create a square element by size information

Anonymous
Not applicable

Hello everyone,
I am trying to create square studs using the Revit API.
I already have studs component information including length, width, height, start and end coordinates, and offset.
Q_1.jpg
Two methods have been tried so far:
(1) Use a "wall" to build "vertical studs".
The code is shown in Figure :


WALL_1.jpg

But I found a problem is that the wall cannot control the "y-direction offset".

The second method is to use the beam:
(1) Use "beam" to build "horizontal" studs
Co_1.jpg

But the beam's method seems to be unable to control its length and width.
Its size can only be controlled by the type of beam.

The results are as follows:


f_1.jpg


Questions:
Is there a better and more convenient way to have both vertical and horizontal Studs built at the same time?
Or how to improve in the currently completed method?
(1) How to set the Y-direction offset value of the wall
(2) How to control the length and width of the beam in the code.



Any relevant help will be appreciated.
Thank you.

0 Likes
Accepted solutions (1)
723 Views
2 Replies
Replies (2)
Message 2 of 3

jeremytammik
Autodesk
Autodesk
Accepted solution

You probably can make use of a wall or a beam to achieve what you want by using additional options and settings.

 

Here is an example of mis-using a roof to create a stair-shaped element:

 

https://thebuildingcoder.typepad.com/blog/2014/09/events-again-and-creating-an-extrusion-roof.html#7

 

As far as I can tell, the perfect solution for you task is a DirectShape:

 

https://thebuildingcoder.typepad.com/blog/about-the-author.html#5.50

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 3 of 3

Anonymous
Not applicable

Thanks for your advice.

I have tried the method of Family Create.NewExtrusion() to build the square directly.
But I found that this method can only be applied to the Family Template.
I hope that it can be implemented in the Architectural template.

0 Likes