I am new in Revit develop.
I want to uncut the beam and column as shown in the picture.
I can do it manually, by "modify > geometry > uncut".
I want to do it by api.
I try to use SolidSolidCutUtils.RemoveCutBetweenSolids(doc, e1, e2); where e1 is the beam and e2 is the column but nothing happened.
Does anyone know the correct way to do it?
My code is something like this:
using Autodesk.Revit.DB; using Autodesk.Revit.UI; using Autodesk.Revit.Attributes; [TransactionAttribute(TransactionMode.Manual)] [RegenerationAttribute(RegenerationOption.Manual)] public class Unjoin : IExternalCommand { public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements) { UIApplication uiApp = commandData.Application; Document doc = uiApp.ActiveUIDocument.Document; Transaction trans = new Transaction(doc); trans.Start("Unjoin"); unjoin(doc, BuiltInCategory.OST_Columns); unjoin(doc, BuiltInCategory.OST_Walls); unjoin(doc, BuiltInCategory.OST_StructuralFraming); trans.Commit(); return Result.Succeeded; } void unjoin(Document doc, BuiltInCategory cat) { foreach (Element e1 in new FilteredElementCollector(doc).OfCategory(cat)) { foreach (ElementId id in SolidSolidCutUtils.GetCuttingSolids(e1)) { Element e2 = doc.GetElement(id); SolidSolidCutUtils.RemoveCutBetweenSolids(doc, e1, e2); } foreach (ElementId id in SolidSolidCutUtils.GetSolidsBeingCut(e1)) { Element e2 = doc.GetElement(id); SolidSolidCutUtils.RemoveCutBetweenSolids(doc, e2, e1); } foreach (ElementId id in JoinGeometryUtils.GetJoinedElements(doc, e1)) { Element e2 = doc.GetElement(id); JoinGeometryUtils.UnjoinGeometry(doc, e1, e2); SolidSolidCutUtils.RemoveCutBetweenSolids(doc, e1, e2); } } } }
Have you tried using the GeometryInstance class GetSymbolGeometry method?
http://www.revitapidocs.com/2017/7daa0e66-9921-3214-91f4-028e8cfd2618.htm
"Computes the geometric representation of the symbol which generates this instance."
Merry Xmas!
Cheers,
Jeremy
Thank you for your reply.
Could you please provide more information about that?
I want to export the revit model into ifc file without cut between columns and beams. Can I achieve this by using GetSymbolGeometry?
Can't find what you're looking for? Ask the community or share your knowledge.