/// <summary>
        /// This should be called on all callbacks defined in ISwComFeature to
        /// initialize all the instance variables.
        /// </summary>
        /// <param name="app"></param>
        /// <param name="modelDoc"></param>
        /// <param name="feature"></param>
        private void Init(object app, object modelDoc, object feature)
        {
            if (app == null)
            {
                throw new ArgumentNullException(nameof(app));
            }
            if (modelDoc == null)
            {
                throw new ArgumentNullException(nameof(modelDoc));
            }
            // feature can be null

            SwApp = (ISldWorks)app;
            if (feature != null)
            {
                SwFeature     = (IFeature)feature;
                SwFeatureData = (IMacroFeatureData)SwFeature.GetDefinition();
                Database      = SwFeatureData.Read <TData>();
            }
            else
            {
                Database = new TData();
            }
            ModelDoc = (IModelDoc2)modelDoc;
        }
Пример #2
0
 internal SwFeatureDimensionsCollection(SwFeature feat, ISwDocument doc, ISwApplication app)
 {
     m_Feat = feat;
     m_Doc  = doc;
     m_App  = app;
 }
Пример #3
0
 internal SwFeatureDimensionsCollection(ISwDocument doc, SwFeature feat)
 {
     m_Doc  = doc;
     m_Feat = feat;
 }
 /// <summary>
 /// Save all selection and parameters and modify the definition of the macro feature
 /// </summary>
 private void ModifyDefinition()
 {
     SaveSelections();
     SwFeatureData.Write(Database);
     SwFeature.ModifyDefinition(SwFeatureData, ModelDoc, null);
 }