Skip to content

Instantly share code, notes, and snippets.

@chuongmep
Created January 30, 2024 09:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chuongmep/b06b2156427f5dd769f51ea636b4892c to your computer and use it in GitHub Desktop.
Save chuongmep/b06b2156427f5dd769f51ea636b4892c to your computer and use it in GitHub Desktop.
// get all reference with connector 1
List<Autodesk.Revit.DB.Connector> connectorSets = connectors1.Select(x => x.AllRefs)
.SelectMany(x => x.Cast<Autodesk.Revit.DB.Connector>())
.ToList();
// disconnect all reference with connector 1
connectors1.ForEach(x =>
{
connectorSets.ForEach(a =>
{
if (x.IsConnectedTo(a))
{
x.DisconnectFrom(a);
}
});
});
// regenerate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment