Is it possible to clone and retrim a surface?

Is it possible to clone and retrim a surface?

stefanome
Collaborator Collaborator
418 Views
4 Replies
Message 1 of 5

Is it possible to clone and retrim a surface?

stefanome
Collaborator
Collaborator

I would like to get a face (for example with uidoc.Selection.PickObject(ObjectType.Face, prompt)), then calculate some CurveLoops on the surface, then, for each curveloop, clone the surface and trim it with its curveloop.

 

Imagine a workflow where the user picks a face, the add-in calculates one curveloop per panel and generates one face per panel. I am thinking about cloning and re-trimming rather than creating the surface from scratch, because I guess it would be easier, especially with non planar surfaces.

 

I wasn't able to clone a Face or a Surface.

 

I wasn't able to trim an existing Face or Surface.

 

I looked into creating a surface from scratch, but the GeometryCreationUtilities class seems to only create planar closed solids, not one single surface, even less a curved one.

0 Likes
419 Views
4 Replies
Replies (4)
Message 2 of 5

RPTHOMAS108
Mentor
Mentor

That kind of face geometry is ReadOnly to API, you can't modify geometry that belongs to an element. You can create direct shapes (using shape builders), forms in family environment etc. (only some of the things possible in the UI). 

0 Likes
Message 3 of 5

stefanome
Collaborator
Collaborator

I am not trying to modify the picked face. I would like to pick a face, get the element, get its geometry, clone it, trim it and create a new element with the new trimmed geometry.

 

... but I guest this doesn't change your answer: I can't.

 

I will try using BRepBuilder and DirectShape 😞

0 Likes
Message 4 of 5

RPTHOMAS108
Mentor
Mentor

BRepBuilder is quite awkward more for translation and parsing of other graphical formats into Revit I hear.

 

TessellatedShapeBuilder seems more straightforward i.e. I expect you could input the triangles direct from Face.Triangulate mesh of modified solid.

 

Then again if you can modify a solid you can use that for a direct shape directly. The awkward thing is always face creation.

 

TessellatedShapeBuilder.Fallback  Mesh could be utilised perhaps.

0 Likes
Message 5 of 5

stefanome
Collaborator
Collaborator

I am still exploring, but at this point I think that using TessellatedShapeBuilder would make my life a little easier, but would not allow to "retrim" the face, as I mentioned in the subject.

 

Using BRepBuilder will be a little harder, but I will be able to use a different set of boundaries.

 

I was hoping to find some API similar to SetBoundary(Surface, CurveLoops), but I guess I will need to create my own 😞

0 Likes