intern developer

intern developer

Anonymous
Not applicable
641 Views
5 Replies
Message 1 of 6

intern developer

Anonymous
Not applicable

Hi ,I am trying to create a face from modellines (which includes both lines and curves) and then using that face as a based for creating a direct shape.are there any option for creating the face?
Thanks so much,

0 Likes
Accepted solutions (1)
642 Views
5 Replies
Replies (5)
Message 2 of 6

naveen.kumar.t
Autodesk Support
Autodesk Support

Hi @Anonymous ,

Try using this below link

https://forums.autodesk.com/t5/revit-api-forum/directshape-from-floor-faces/td-p/7551143 


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

Message 3 of 6

Anonymous
Not applicable

Hi 

 all model line based on the graphic style in whole doc than doing selection.

0 Likes
Message 4 of 6

naveen.kumar.t
Autodesk Support
Autodesk Support

Hi @Anonymous ,

 

From my understanding, it is not possible to create a face directly via API.

 

First, understand what is face is and how it works in Revit

https://www.revitapidocs.com/2015/e32b3b1f-66fc-57cb-6e1c-aa81d1bf3e63.htm

https://thebuildingcoder.typepad.com/blog/2010/01/faces.html

 

My suggestion is to create an extrusion element from a set of model lines and from the created element you can get the faces.

https://www.revitapidocs.com/2020/c21472c0-2825-819c-226f-bc8e00ddfec8.htm

 

Also, check this below link

https://forums.autodesk.com/t5/revit-api-forum/how-to-create-face-from-boundary-loop-curves/td-p/9462158

 

 

 

 

 

 

 

 

 


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 5 of 6

naveen.kumar.t
Autodesk Support
Autodesk Support
Accepted solution

Hi @Anonymous ,

To get the face

 //Element created by the model line
                Element e;

                Options option = app.Create.NewGeometryOptions();
                option.ComputeReferences = true;
                option.IncludeNonVisibleObjects = true;
                option.View = doc.ActiveView;

                GeometryElement geoElement = e.get_Geometry(option) as GeometryElement;
                foreach(GeometryObject geoObject in geoElement)
                {
                    Solid solid = geoObject as Solid;

                    //The Face Array contains all the faces and from the face array, you can get your required face
                    FaceArray faceArray = solid.Faces;
                }

Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

Message 6 of 6

Anonymous
Not applicable

Thanks so much,

0 Likes