Managing of Edit Bodies in SOLIDWORKS macro feature

Edit ArticleEdit Article
Comments

Edit bodies are input bodies which macro feature will acquire. For example when boss-extrude feature is created using the merge bodies option the solid body it is based on became a body of the new boss-extrude. This could be validated by selecting the feature in the tree which will select the body as well. In this case the original body was passed as an edit body to the boss-extrude feature.

public class MacroFeatureParams
{
    [ParameterEditBody]
    public IBody2 InputBody { get; set; }
}

If multiple input bodies are required it could be either specified in different properties

public class MacroFeatureParams
{
    [ParameterEditBody]
    public IBody2 EditBody1 { get; set; }

    [ParameterEditBody]
    public IBody2 EditBody2 { get; set; }
}

or as list

public class MacroFeatureParams
{
    [ParameterEditBody]
    public List<IBody2> EditBodies { get; set; }
}

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