@@ -126,7 +126,12 @@ public static double Radius(Autodesk.Revit.DB.Connector connector)
126126 . ConnectorManager ?
127127 . Connectors ;
128128 }
129-
129+ if ( e is FabricationPart )
130+ {
131+ return ( ( FabricationPart ) e ) ?
132+ . ConnectorManager ?
133+ . Connectors ;
134+ }
130135 return null ;
131136 }
132137
@@ -300,7 +305,7 @@ public static double Radius(Autodesk.Revit.DB.Connector connector)
300305 public static List < Autodesk . Revit . DB . Connector ? > GetUsedConnectors ( Revit . Elements . Element ? element )
301306 {
302307 if ( element == null ) throw new ArgumentNullException ( nameof ( element ) ) ;
303- if ( GetConnectors ( element ) . Any ( ) ) return new List < Autodesk . Revit . DB . Connector ? > ( ) ;
308+ if ( ! GetConnectors ( element ) . Any ( ) ) return new List < Autodesk . Revit . DB . Connector ? > ( ) ;
304309 return GetConnectors ( element ) . Where ( x => x ! . IsConnected ) . ToList ( ) ;
305310 }
306311
@@ -883,4 +888,60 @@ public static Autodesk.Revit.DB.Connector ConnectTo(Autodesk.Revit.DB.Connector
883888 CoordinateSystem coordinateSystem = Autodesk . DesignScript . Geometry . CoordinateSystem . ByOriginVectors ( point , X , Y , Z ) ;
884889 return OpenMEPSandbox . Geometry . CoordinateSystem . Display ( coordinateSystem , length ) ;
885890 }
891+
892+ /// <summary>
893+ /// Identifies if the connector is connected to the specified connector.
894+ /// </summary>
895+ /// <param name="connector">the connector to check</param>
896+ /// <param name="connectorOther">the second connector to identifies</param>
897+ /// <returns name="bool">true if connector is connected to other</returns>
898+ public static bool IsConnectedTo ( Autodesk . Revit . DB . Connector connector , Autodesk . Revit . DB . Connector connectorOther )
899+ {
900+ return connector . IsConnectedTo ( connectorOther ) ;
901+ }
902+
903+ // /// <summary>Gets fabrication connectivity information.</summary>
904+ // /// <para name="connector">the connector</para>
905+ // /// <since>2016</since>
906+ // [MultiReturn("BodyConnectorId", "DoubleWallConnectorId", "FabricationIndex", "IsBodyConnectorLocked",
907+ // "IsDoubleWallConnectorLocked", "HasDoubleWallConnector", "IsValid")]
908+ // public static Dictionary<string, object?> GetFabricationConnectorInfo(Autodesk.Revit.DB.Connector connector)
909+ // {
910+ // if (connector == null) throw new ArgumentException(nameof(connector));
911+ // FabricationConnectorInfo fabricationConnectorInfo = connector.GetFabricationConnectorInfo();
912+ // if (fabricationConnectorInfo == null)
913+ // {
914+ // return new Dictionary<string, object?>
915+ // {
916+ // {"BodyConnectorId", null},
917+ // {"DoubleWallConnectorId", null},
918+ // {"FabricationIndex", null},
919+ // {"IsBodyConnectorLocked", null},
920+ // {"IsDoubleWallConnectorLocked", null},
921+ // {"HasDoubleWallConnector", null},
922+ // {"IsValid", null}
923+ // };
924+ // }
925+ // int? DoubleWallConnectorId = null;
926+ // bool? IsDoubleWallConnectorLocked = null;
927+ // try
928+ // {
929+ // DoubleWallConnectorId = fabricationConnectorInfo.DoubleWallConnectorId;
930+ // IsDoubleWallConnectorLocked = fabricationConnectorInfo.IsDoubleWallConnectorLocked;
931+ // }
932+ // catch (Exception e)
933+ // {
934+ // //TODO: no things
935+ // }
936+ // return new Dictionary<string, object?>
937+ // {
938+ // {"BodyConnectorId", fabricationConnectorInfo.BodyConnectorId},
939+ // {"DoubleWallConnectorId",DoubleWallConnectorId },
940+ // {"FabricationIndex", fabricationConnectorInfo.FabricationIndex},
941+ // {"IsBodyConnectorLocked", fabricationConnectorInfo.IsBodyConnectorLocked},
942+ // {"IsDoubleWallConnectorLocked",IsDoubleWallConnectorLocked },
943+ // {"HasDoubleWallConnector", fabricationConnectorInfo.HasDoubleWallConnector()},
944+ // {"IsValid", fabricationConnectorInfo.IsValid()},
945+ // };
946+ // }
886947}
0 commit comments