Number Box in SOLIDWORKS Property Manager Page

Edit ArticleEdit Article
Comments

Simple number box
Simple number box

Number box will be automatically created for the properties of int and double types.

using CodeStack.SwEx.PMPage.Attributes;
using SolidWorks.Interop.swconst;

public class NumberBoxDataModel
{
    public int Number { get; set; }
    public double FloatingNumber { get; set; }

}

Style of the number box can be customized via the NumberBoxOptionsAttribute

Number boxes with additional styles allowing specifying the units and displaying thumbwheel for changing the value
Number boxes with additional styles allowing specifying the units and displaying thumbwheel for changing the value

using CodeStack.SwEx.PMPage.Attributes;
using SolidWorks.Interop.swconst;

public class NumberBoxDataModel
{

    [NumberBoxOptions(swNumberboxUnitType_e.swNumberBox_Length, 0, 1000, 0.01, true, 0.02, 0.001,
        swPropMgrPageNumberBoxStyle_e.swPropMgrPageNumberBoxStyle_Thumbwheel)]
    public double Length { 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