Managing selection of SOLIDWORKS macro feature

Edit ArticleEdit Article
Comments
public class MacroFeatureParams
{
    //selection parameter of any entity (e.g. face, edge, feature etc.)
    [ParameterSelection]
    public object AnyEntity { get; set; }

    //selection parameter of body
    [ParameterSelection]
    public IBody2 Body { get; set; }

    //selection parameter of array of faces
    [ParameterSelection]
    public List<IFace2> Faces { get; set; }

Parameter properties can be specified either using the direct SOLIDWORKS type or as object if type is unknown. List of selections is also supported.

OnRebuild handler will be called if any of the selections have changed.

Notifications

All articles and code at CodeStack are now open-source and hosted on GitHub. If you want to contribute by modifying existing articles and code snippets, submitting new ones, reporting errors and bugs etc. please follow this blog post for more information. We appreciate any contribution.


Product of Xarial Product of Xarial