Exemplo n.º 1
0
 internal SwCutListCustomProperty(CustomPropertyManager prpMgr, string name,
                                  ISwDocument3D refDoc, ISwConfiguration refConf, bool isCommited, ISwApplication app)
     : base(prpMgr, name, isCommited, app)
 {
     m_RefDoc  = refDoc;
     m_RefConf = refConf;
 }
Exemplo n.º 2
0
        internal SwCutListCustomPropertiesCollection(CustomPropertyManager prpsMgr,
                                                     ISwDocument3D parentDoc, ISwConfiguration parentConf, ISwApplication app)
            : base((SwDocument)parentDoc, app)
        {
            PrpMgr = prpsMgr;

            m_ParentDoc  = parentDoc;
            m_ParentConf = parentConf;
        }
Exemplo n.º 3
0
        internal SwCutListItem(IFeature feat, ISwDocument3D doc, ISwApplication app, bool created) : base(feat, doc, app, created)
        {
            if (feat.GetTypeName2() != "CutListFolder")
            {
                throw new InvalidCastException("Specified feature is not a cut-list feature");
            }

            m_ParentDoc  = doc;
            m_ParentConf = doc.Configurations.Active;

            CutListBodyFolder = (IBodyFolder)feat.GetSpecificFeature2();

            m_Properties = new Lazy <ISwCustomPropertiesCollection>(
                () => CreatePropertiesCollection());
        }
Exemplo n.º 4
0
 internal void SetParent(ISwDocument3D doc, ISwConfiguration conf)
 {
     m_ParentDoc  = doc;
     m_ParentConf = conf;
 }
Exemplo n.º 5
0
        internal static IEnumerable <SwCutListItem> IterateCutLists(this SwFeatureManager featMgr, ISwDocument3D parent, ISwConfiguration refConf)
        {
            foreach (var feat in FeatureEnumerator.IterateFeatures(featMgr.GetFirstFeature(), false))
            {
                if (feat.GetTypeName2() == "SolidBodyFolder")
                {
                    foreach (var subFeat in FeatureEnumerator.IterateSubFeatures(feat, true))
                    {
                        if (subFeat.GetTypeName2() == "CutListFolder")
                        {
                            var cutListFolder = (IBodyFolder)subFeat.GetSpecificFeature2();

                            if (cutListFolder.GetBodyCount() > 0)//no bodies for hidden cut-lists (not available in the specific configuration)
                            {
                                var cutList = featMgr.Document.CreateObjectFromDispatch <SwCutListItem>(subFeat);
                                cutList.SetParent(parent, refConf);
                                yield return(cutList);
                            }
                        }
                    }

                    break;
                }
                else if (feat.GetTypeName2() == "RefPlane")
                {
                    break;
                }
            }

            yield break;
        }