SOLIDWORKS 属性管理器页面中的数字框
数字框将自动为 int 和 double 类型的属性创建。
Imports CodeStack.SwEx.PMPage.Attributes
Imports SolidWorks.Interop.swconst
Public Class NumberBoxDataModel
Public Property Number As Integer
Public Property FloatingNumber As Double
End Class
using CodeStack.SwEx.PMPage.Attributes;
using SolidWorks.Interop.swconst;
public class NumberBoxDataModel
{
public int Number { get; set; }
public double FloatingNumber { get; set; }
}
可以通过 NumberBoxOptionsAttribute 自定义数字框的样式。
Imports CodeStack.SwEx.PMPage.Attributes
Imports 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 Property Length As Double
End Class
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; }
}