Place face based opening on Structural Column Element

I am trying to create a face based opening on the intersection of the model line and the structural member. Can any one suggest any solution with python or API.

One option would be to select the face of the column. Get the intersection point of the line to that face. Then you can use the Springs.FamilyInstance.ByFacePoints node to insert the opening based on the face and the intersection point.

image

Placing the opening family is not much of a issue.

Getting the type of opening is the main problem here. Also I could not find any API that create this structural opening on Structural Columns or Beams.
What I am actually want to achieve is
2
on structural elements. I am quite sure, there must be something in API can do the job as Metal Wood Framing Plugin is doing the same for MEP punch outs.

Apologies for misunderstanding your intent. Look at NewOpening in the API. This has the option for inserting an opening into a column.

Thanks @staylor I have prepared a script for the same but not sure why it is saying that the curve loops are not closed If someone can help me to understand the issue that would be great.

import clr

clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *
from Autodesk.Revit.Creation import *

clr.AddReference("System")
from System.Collections.Generic import List

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

import math

doc = DocumentManager.Instance.CurrentDBDocument

openings = []

beams = IN[0]
loops = IN[1]

for i in range(0,len(beams)):
		
	el = doc.GetElement(ElementId(beams[i].Id))
		
	ca = CurveArray()
		
	for c in loops[i]:
		
		curve1 = c.ToRevitType(True)
		ca.Append(curve1)
						
	TransactionManager.Instance.EnsureInTransaction(doc)
	opening = doc.Create.NewOpening.Overloads[Element, CurveArray, eRefFace](el, ca, eRefFace.CenterY)
	TransactionManager.Instance.TransactionTaskDone()	
					
	openings.append(ca)

OUT = openings

I tested out this script on non-circular geometry. It’s working fine. It seems like I am only getting the error when I am trying to create a circular opening.

Reply to post 3:
Try Element.ElementType

Hi @diptajit could it work if you split the curves ? nice one btw:) thx

Revit_Jr42BHuPjL

Thanks @sovitek :clap: :clap: :clap: splitting the curve resolves the issue. But don’t you think it’s a little counter-intuitive? There should be a straightforward way to create a face base round opening. I tried to input a list of lists to the curve loop but still, it is giving the same error.

1 Like

allright…i havent go deep into it ;)…could you show your graph with the error ?? is it a beam or column you try on ?..if it columns it will only work on one side as i saw ref is set to refY, thats probably why

PS… its rare i do that kind i would say never …my structural engineers dont like it :wink: what is the reason ?

I am trying it on Structural Framing. The top image kind of shows the error which is saying the curve is not closed. I think it is expecting a list of curves. So it is working with all other geometry where it has more than one curve but not working with the circle as it have a single curve. Splitting it kind of resolves the issue but there must be something we are missing.

Maybe you could try a faceted circle with 80 facets
No sure, haven’t tested

@Marcel_Rijsmus thanks for your input but I believe we have to sacrifice the flexibility of using a single curve circle if we use a faceted circle. The current solution of splitting the curve is working for me. But I was just curious, why a single curve circle is not working or what modification is required to make it work with the newOpening object.

2 Likes