Exemplo n.º 1
0
 public void EmitPipeData(DataNode data)
 {
     try
     {
         _receivedObjects = new List <object>();
         if (data == null)
         {
             return;
         }
         foreach (var child in data.ChildrenList)
         {
             var converted = PipeForRevit.ConvertFromPipe(child.Data);
             if (converted.GetType().IsArray)
             {
                 foreach (var obj in (Array)converted)
                 {
                     _receivedObjects.Add(obj);
                 }
             }
             else
             {
                 _receivedObjects.Add(converted);
             }
         }
     }
     catch (PipeDataModel.Exceptions.PipeConversionException e)
     {
         RevitPipeUtil.ShowMessage("Pipe Pull Failed!", "Conversion Error - Unsupported Types", e.Message +
                                   "\nPlease try bringing this geometry as one of the supported types, or try bringing it via Dynamo since ThePipe extension" +
                                   "for Dynamo supports more types than the revit add-in.");
     }
 }
Exemplo n.º 2
0
        public DataNode CollectPipeData()
        {
            DataNode node = new DataNode();

            foreach (var geom in _selectedObjects)
            {
                node.AddChild(new DataNode(PipeForRevit.ConvertToPipe(geom)));
            }
            return(node);
        }