Пример #1
0
        /// <summary>
        /// Create a hosted-sweep according to the CreationData parameter.
        /// </summary>
        /// <param name="creationData">CreationData parameter</param>
        /// <returns>ModificationData which contains the created hosted-sweep</returns>
        public ModificationData Create(CreationData creationData)
        {
            ReferenceArray refArr = new ReferenceArray();

            foreach (Edge edge in creationData.EdgesForHostedSweep)
            {
                refArr.Append(edge.Reference);
            }

            ModificationData modificationData = null;
            Transaction      transaction      = new Transaction(m_rvtDoc, "CreateHostedSweep");

            try
            {
                transaction.Start();
                HostedSweep createdHostedSweep = CreateHostedSweep(creationData.Symbol, refArr);

                if (transaction.Commit() == TransactionStatus.Committed)
                {
                    m_rvtUIDoc.ShowElements(createdHostedSweep);

                    // just only end transaction return true, we will create the hosted sweep.
                    modificationData =
                        new ModificationData(createdHostedSweep, creationData);
                    m_createdHostedSweeps.Add(modificationData);
                }
            }
            catch
            {
                transaction.RollBack();
            }
            return(modificationData);
        }
 /// <summary>
 /// Exports a hosted weep.
 /// </summary>
 /// <param name="exporterIFC">The ExporterIFC object.</param>
 /// <param name="hostedSweep">The hosted sweep element.</param>
 /// <param name="geometryElement">The geometry element.</param>
 /// <param name="productWrapper">The ProductWrapper.</param>
 public static void Export(ExporterIFC exporterIFC, HostedSweep hostedSweep, GeometryElement geometryElement, ProductWrapper productWrapper)
 {
     ElementId catId = CategoryUtil.GetSafeCategoryId(hostedSweep);
     if (catId == new ElementId(BuiltInCategory.OST_Gutter))
         ExportGutter(exporterIFC, hostedSweep, geometryElement, productWrapper);
     else
         ProxyElementExporter.Export(exporterIFC, hostedSweep, geometryElement, productWrapper);
 }
 /// <summary>
 /// Exports a hosted weep.
 /// </summary>
 /// <param name="exporterIFC">The ExporterIFC object.</param>
 /// <param name="hostedSweep">The hosted sweep element.</param>
 /// <param name="geometryElement">The geometry element.</param>
 /// <param name="productWrapper">The ProductWrapper.</param>
 public static void Export(ExporterIFC exporterIFC, HostedSweep hostedSweep, GeometryElement geometryElement, ProductWrapper productWrapper)
 {
    ElementId catId = CategoryUtil.GetSafeCategoryId(hostedSweep);
    if (catId == new ElementId(BuiltInCategory.OST_Gutter))
       ExportGutter(exporterIFC, hostedSweep, geometryElement, productWrapper);
    else
       ProxyElementExporter.Export(exporterIFC, hostedSweep, geometryElement, productWrapper);
 }
Пример #4
0
        /// <summary>
        /// Constructor with HostedSweep and CreationData as parameters.
        /// </summary>
        /// <param name="elem">Element to modify</param>
        /// <param name="creationData">CreationData</param>
        public ModificationData(HostedSweep elem, CreationData creationData)
        {
            m_rvtDoc       = creationData.Creator.RvtDocument;
            m_rvtUIDoc     = creationData.Creator.RvtUIDocument;
            m_elemToModify = elem;
            m_creationData = creationData;

            m_transaction = new Transaction(m_rvtDoc, "External Tool");

            m_creationData.EdgeAdded +=
                new CreationData.EdgeEventHandler(m_creationData_EdgeAdded);
            m_creationData.EdgeRemoved +=
                new CreationData.EdgeEventHandler(m_creationData_EdgeRemoved);
            m_creationData.SymbolChanged +=
                new CreationData.SymbolChangedEventHandler(m_creationData_SymbolChanged);
        }
Пример #5
0
        /// <summary>
        /// Constructor with HostedSweep and CreationData as parameters.
        /// </summary>
        /// <param name="elem">Element to modify</param>
        /// <param name="creationData">CreationData</param>
        public ModificationData(HostedSweep elem, CreationData creationData)
        {
            m_rvtDoc = creationData.Creator.RvtDocument;
            m_rvtUIDoc = creationData.Creator.RvtUIDocument;
            m_elemToModify = elem;
            m_creationData = creationData;

            m_transaction = new Transaction(m_rvtDoc, "External Tool");

            m_creationData.EdgeAdded +=
                new CreationData.EdgeEventHandler(m_creationData_EdgeAdded);
            m_creationData.EdgeRemoved +=
                new CreationData.EdgeEventHandler(m_creationData_EdgeRemoved);
            m_creationData.SymbolChanged +=
                new CreationData.SymbolChangedEventHandler(m_creationData_SymbolChanged);
        }
Пример #6
0
        private void Stream( ArrayList data, HostedSweep hostedSweep )
        {
            data.Add( new Snoop.Data.ClassSeparator( typeof( HostedSweep ) ) );

              data.Add( new Snoop.Data.Angle( "Angle", hostedSweep.Angle ) );
              data.Add( new Snoop.Data.Bool( "Horizontal flip", hostedSweep.HorizontalFlipped ) );
              data.Add( new Snoop.Data.Double( "Horizontal offset", hostedSweep.HorizontalOffset ) );
              data.Add( new Snoop.Data.Bool( "Vertical flip", hostedSweep.VerticalFlipped ) );
              data.Add( new Snoop.Data.Double( "Vertical offset", hostedSweep.VerticalOffset ) );
              data.Add( new Snoop.Data.Double( "Length", hostedSweep.Length ) );

              Fascia fascia = hostedSweep as Fascia;
              if( fascia != null )
              {
            Stream( data, fascia );
            return;
              }

              Gutter gutter = hostedSweep as Gutter;
              if( gutter != null )
              {
            Stream( data, gutter );
            return;
              }

              SlabEdge slabEdge = hostedSweep as SlabEdge;
              if( slabEdge != null )
              {
            Stream( data, slabEdge );
            return;
              }
        }