Handling the SOLIDWORKS macro feature state update in SwEx.MacroFeature framework

Edit ArticleEdit Article

This handler is called every time state of the feature is changed. It should be used to provide additional security for macro feature.

protected override swMacroFeatureSecurityOptions_e OnUpdateState(ISldWorks app, IModelDoc2 model, IFeature feature)
{
    //disallow editing or suppressing of the feature
    return swMacroFeatureSecurityOptions_e.swMacroFeatureSecurityCannotBeDeleted 
                | swMacroFeatureSecurityOptions_e.swMacroFeatureSecurityCannotBeSuppressed;
}

Product of Xarial Product of Xarial