Disable the error highlighted elements are joined but do not intersect

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
When I want to join wall and structural framing it shows error that highlighted elements are joined but do not intersect. What this error mean?
And if I want to disable this error and create own taskdialog box and display my error how I do this?
this is my code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
namespace JoinGeometry
{
[Transaction(TransactionMode.Manual)]
class WBjoin
{
bool check;
public Result Execute(ExternalCommandData commandData)
{
UIApplication uiApp = commandData.Application;
// UIDocument uiDoc = uiApp.ActiveUIDocument;
// Application app = uiApp.Application;
// Document doc = uiDoc.Document;
UIDocument uidoc = uiApp.ActiveUIDocument;
Document doc = uidoc.Document;
//--get walls on the active view-----------
FilteredElementCollector collWalls = new FilteredElementCollector(doc, doc.ActiveView.Id);
collWalls.OfClass(typeof(Wall));
foreach (Wall w in collWalls)
{
FilteredElementCollector wallbeam = new FilteredElementCollector(doc, doc.ActiveView.Id);
wallbeam.OfClass(typeof(FamilyInstance));
wallbeam.OfCategory(BuiltInCategory.OST_StructuralFraming);
BoundingBoxXYZ bb = w.get_BoundingBox(doc.ActiveView);
Outline outline = new Outline(bb.Min, bb.Max);
BoundingBoxIntersectsFilter bbfilter =
new BoundingBoxIntersectsFilter(outline);
wallbeam.WherePasses(bbfilter);
foreach (FamilyInstance bem in wallbeam)
{
using (Transaction t = new Transaction(doc, "Join All Walls/beam"))
{
t.Start();
try
{
check = JoinGeometryUtils.AreElementsJoined(doc, w, bem);
if (check == true)
{
}
else
{
JoinGeometryUtils.JoinGeometry(doc, w, bem);
}
}
catch
{
TaskDialog.Show("revit", "cannot joined");
}
t.Commit();
}
}
}
return Result.Succeeded;
}
}
}