NXOpen.BlockStyler的一些用法
生活随笔
收集整理的這篇文章主要介紹了
NXOpen.BlockStyler的一些用法
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
關(guān)于BLOCK UI的一些控件的用法,本人曾經(jīng)使用的代碼,拿出來共享:
Option Strict OffImports NXOpen Imports NXOpen.BlockStyler Imports System.Runtime.InteropServicesNamespace Bizca.NX.UIBlockStylerPublic Module UIBlockStylerEx<System.Runtime.CompilerServices.Extension()> _<Obsolete>Public Function GetPropertiesEx(ByVal block As NXOpen.BlockStyler.UIBlock) As UIBlockExReturn New UIBlockEx(block)End Function'#Region "ListBox"' <System.Runtime.CompilerServices.Extension()> _' Public Sub SetListItems(ByVal ListBox As NXOpen.BlockStyler.ListBox, ByVal stringArray() As String)' ListBox.GetProperties.SetStrings("ListItems", stringArray)' End Sub' <System.Runtime.CompilerServices.Extension()> _' Public Function GetListItems(ByVal ListBox As NXOpen.BlockStyler.ListBox) as String()' Return ListBox.GetProperties.GetStrings("ListItems")' End Function'#End RegionEnd Module'Public Class ListBoxEx' Inherits NXOpen.BlockStyler.ListBox' Private ower As NXOpen.BlockStyler.ListBox' Public Sub New(ByVal block As NXOpen.BlockStyler.ListBox)' Me.ower = block' End Sub' Property DDDD As String' Public Shared Sub DSS()' With New ListBoxEx(Nothing)' .DDDD = "FFF"' End With' Dim AAAA = Function(X As NXOpen.Tag)' Return NXOpen.Utilities.NXObjectManager.Get(X)' End Function' Dim WWW = AAAA(NXOpen.Tag.Null)' End Sub'End ClassPublic Class UIBlockExPrivate ower As NXOpen.BlockStyler.UIBlockPublic Sub New(ByVal block As NXOpen.BlockStyler.UIBlock)Me.ower = blockEnd Sub#Region "General Properties"''' <summary>''' 【通用】設(shè)置UIBlock的是否不禁止''' </summary>''' <value>[CSG] TRUE-Block 不禁止,FALSE-Block 禁止</value>''' <returns>[CSG] TRUE-Block 不禁止,FALSE-Block 禁止</returns>''' <remarks>[CSG] TRUE-Block 不禁止,FALSE-Block 禁止 </remarks>Public Property Enable As BooleanGetReturn Me.ower.GetProperties.GetLogical("Enable")End GetSet(ByVal value As Boolean)Me.ower.GetProperties.SetLogical("Enable", value)End SetEnd Property''' <summary>''' 【通用】設(shè)置UIBlock的是否展開(Block必須擁有自己的組)''' </summary>''' <value>[SG] TRUE- 展開,FALSE- 折疊</value>''' <returns>[SG] TRUE- 展開,FALSE- 折疊</returns>''' <remarks>Block必須擁有自己的組(設(shè)計時才可以指定)</remarks>Public Property Expanded As BooleanGetReturn Me.ower.GetProperties.GetLogical("Expanded")End GetSet(ByVal value As Boolean)Me.ower.GetProperties.SetLogical("Expanded", value)End SetEnd Property''' <summary>''' 【通用】標(biāo)簽''' </summary>''' <value></value>''' <returns></returns>''' <remarks>[CSG] Any String Value </remarks>Public Property Label As StringGetReturn Me.ower.GetProperties.GetString("Label")End GetSet(ByVal value As String)Me.ower.GetProperties.SetString("Label", value)End SetEnd Property''' <summary>''' 【通用】設(shè)置UIBlock的Show可見屬性''' </summary>''' <value>[CSG] TRUE-Block 可見,FALSE-Block 不可見</value>''' <returns>[CSG] TRUE-Block 可見,FALSE-Block 不可見</returns>''' <remarks>Sets the visibility of the block</remarks>Public Property Show As BooleanGetReturn Me.ower.GetProperties.GetLogical("Show")End GetSet(ByVal value As Boolean)Me.ower.GetProperties.SetLogical("Show", value)End SetEnd Property #End Region#Region "Selection"''' <summary>''' 【選擇對象】自動推進''' </summary>''' <value></value>''' <returns></returns>''' <remarks>自動推進到下一個UIBlock</remarks>Public Property AutomaticProgression As BooleanGetReturn Me.ower.GetProperties.GetLogical("AutomaticProgression")End GetSet(ByVal value As Boolean)Me.ower.GetProperties.SetLogical("AutomaticProgression", value)End SetEnd Property''' <summary>''' 【選擇對象】提示字符串''' </summary>''' <value></value>''' <returns></returns>''' <remarks>狀態(tài)欄提示字符串</remarks>Public Property Cue As StringGetReturn Me.ower.GetProperties.GetString("Cue")End GetSet(ByVal value As String)Me.ower.GetProperties.SetString("Cue", value)End SetEnd Property''' <summary>''' 【選擇對象】標(biāo)簽字符串''' </summary>''' <value></value>''' <returns></returns>''' <remarks></remarks>Public Property LabelString As StringGetReturn Me.ower.GetProperties.GetString("LabelString")End GetSet(ByVal value As String)Me.ower.GetProperties.SetString("LabelString", value)End SetEnd Property''' <summary>''' 【選擇對象】點覆蓋''' </summary>''' <value></value>''' <returns></returns>''' <remarks>是否啟用捕捉點</remarks>Public Property PointOverlay As BooleanGetReturn Me.ower.GetProperties.GetLogical("PointOverlay")End GetSet(ByVal value As Boolean)Me.ower.GetProperties.setLogical("PointOverlay",value)End SetEnd Property''' <summary>''' 【選擇對象】設(shè)置選擇過濾器''' </summary>''' <param name="maskAction"></param>''' <param name="maskTriples"></param>''' <remarks></remarks>Public Sub SetSelectionFilter(ByVal maskAction As NXOpen.Selection.SelectionAction, ByVal maskTriples() As NXOpen.Selection.MaskTriple)Me.ower.GetProperties.SetSelectionFilter("SelectionFilter", maskAction, maskTriples)End Sub''' <summary>''' 【選擇對象】選擇的對象''' </summary>''' <value></value>''' <returns></returns>''' <remarks></remarks>Public Property SelectedObjects As NXOpen.TaggedObject()GetReturn Me.ower.GetProperties.GetTaggedObjectVector("SelectedObjects")End GetSet(ByVal value As NXOpen.TaggedObject())If value IsNot Nothing ThenMe.ower.GetProperties.SetTaggedObjectVector("SelectedObjects", value)End IfEnd SetEnd Property''' <summary>''' 【選擇對象】最后取消選擇的對象''' </summary>''' <value></value>''' <returns></returns>''' <remarks></remarks>Public ReadOnly Property LastDeselectedObjects As NXOpen.TaggedObject()GetReturn Me.ower.GetProperties.GetTaggedObjectVector("LastDeselectedObjects")End GetEnd Property''' <summary>''' 【選擇對象】最后選擇的對象''' </summary>''' <value></value>''' <returns></returns>''' <remarks></remarks>Public ReadOnly Property LastSelectedObjects As NXOpen.TaggedObject()GetReturn Me.ower.GetProperties.GetTaggedObjectVector("LastSelectedObjects")End GetEnd Property''' <summary>''' 【選擇對象】步驟的狀態(tài)''' </summary>''' <value>只有當(dāng)初始化的時候才可以設(shè)置該屬性</value>''' <returns></returns>''' <remarks>CIG Required[必須] Optional[可選] Satisfied[滿意]</remarks>Public Property StepStatus As StepStatusEnumGetReturn Me.ower.GetProperties.GetEnum("StepStatus")End GetSet(ByVal value As StepStatusEnum)Me.ower.GetProperties.SetEnum("StepStatus", value)End SetEnd Property''' <summary>''' 步驟的狀態(tài)''' </summary>''' <remarks></remarks>Public Enum StepStatusEnum''' <summary>''' 必要的''' </summary>''' <remarks></remarks>[Required] = 0''' <summary>''' 可選的''' </summary>''' <remarks></remarks>[Optional] = 1''' <summary>''' 滿意的''' </summary>''' <remarks></remarks>[Satisfied] = 2End Enum''' <summary>''' 【選擇對象】拾取點''' </summary>''' <value></value>''' <returns></returns>''' <remarks>選擇對象時在屏幕上觸擊的點</remarks>Public ReadOnly Property PickPoint As NXOpen.Point3dGetReturn Me.ower.GetProperties.GetPoint("PickPoint")End GetEnd Property''' <summary>''' 【指定光標(biāo)位置】顯示臨時點''' </summary>''' <value></value>''' <returns></returns>''' <remarks>Specify Cursor Location</remarks>Public Property DisplayTemporaryPoint As BooleanGetReturn Me.ower.GetProperties.GetLogical("DisplayTemporaryPoint")End GetSet(ByVal value As Boolean)Me.ower.GetProperties.SetLogical("DisplayTemporaryPoint", value)End SetEnd Property''' <summary>''' 【指定光標(biāo)位置】光標(biāo)位置''' </summary>''' <value></value>''' <returns></returns>''' <remarks>Specify Cursor Location</remarks>Public Property CursorLocation As NXOpen.Point3dGetReturn Me.ower.GetProperties.GetPoint("CursorLocation")End GetSet(ByVal value As NXOpen.Point3d)Me.ower.GetProperties.SetPoint("CursorLocation", value)End SetEnd Property''' <summary>''' 【Specify Point】【Specify Vector】點''' </summary>''' <value></value>''' <returns></returns>''' <remarks></remarks>Public Property Point As NXOpen.Point3dGetReturn Me.ower.GetProperties.GetPoint("Point")End GetSet(ByVal value As NXOpen.Point3d)Me.ower.GetProperties.SetPoint("Point", value)End SetEnd Property''' <summary>''' 【Specify Vector】矢量''' </summary>''' <value></value>''' <returns></returns>''' <remarks></remarks>Public Property Vector As Vector3dGetReturn Me.ower.GetProperties.GetVector("Vector")End GetSet(ByVal value As Vector3d)Me.ower.GetProperties.SetVector("Vector", value)End SetEnd Property#End RegionPublic Property LogicalValue As BooleanGetReturn Me.ower.GetProperties.GetLogical("Value")End GetSet(ByVal value As Boolean)Me.ower.GetProperties.SetLogical("Value", value)End SetEnd Property#Region "Enum Block"''' <summary>''' 【Enumeration】枚舉值''' </summary>''' <value></value>''' <returns></returns>''' <remarks></remarks>Public Property EnumValue As IntegerGetReturn Me.ower.GetProperties.GetEnum("Value")End GetSet(ByVal value As Integer)Me.ower.GetProperties.SetEnum("Value", value)End SetEnd Property''' <summary>''' 【Enumeration】枚舉字符串''' </summary>''' <value></value>''' <returns></returns>''' <remarks></remarks>Public Property EnumAsString As StringGetReturn Me.ower.GetProperties.GetEnumAsString("Value")End GetSet(ByVal value As String)Me.ower.GetProperties.SetEnumAsString("Value", value)End SetEnd Property''' <summary>''' 【Enumeration】枚舉字符串?dāng)?shù)組成員''' </summary>''' <value></value>''' <returns></returns>''' <remarks></remarks>Public Property EnumMembers As String()GetReturn Me.ower.GetProperties.GetEnumMembers("Value")End GetSet(ByVal value As String())Me.ower.GetProperties.SetEnumMembers("Value", value)End SetEnd Property#End Region#Region "Expression"''' <summary>''' 【表達式】【線性尺寸】【角度尺寸】【半徑尺寸】【軌跡上的尺寸(沿曲線的位置)】表達式''' </summary>''' <value></value>''' <returns></returns>''' <remarks></remarks>Public Property Formula As StringGetReturn Me.ower.GetProperties.GetString("Formula")End GetSet(ByVal value As String)Me.ower.GetProperties.SetString("Formula", value)End SetEnd Property''' <summary>''' 【線性尺寸】【半徑尺寸】手柄方向''' </summary>''' <value></value>''' <returns></returns>''' <remarks></remarks>Public Property HandleOrientation As NXOpen.Vector3dGetReturn Me.ower.GetProperties.GetVector("HandleOrientation")End GetSet(ByVal value As NXOpen.Vector3d)Me.ower.GetProperties.SetVector("HandleOrientation", value)End SetEnd Property''' <summary>''' 【角度尺寸】手柄X軸方向''' </summary>''' <value></value>''' <returns></returns>''' <remarks></remarks>Public Property HandleXAxis As NXOpen.Vector3dGetReturn Me.ower.GetProperties.GetVector("HandleXAxis")End GetSet(ByVal value As NXOpen.Vector3d)Me.ower.GetProperties.SetVector("HandleXAxis", value)End SetEnd Property''' <summary>''' 【角度尺寸】手柄Z軸方向''' </summary>''' <value></value>''' <returns></returns>''' <remarks></remarks>Public Property HandleZAxis As NXOpen.Vector3dGetReturn Me.ower.GetProperties.GetVector("HandleZAxis")End GetSet(ByVal value As NXOpen.Vector3d)Me.ower.GetProperties.SetVector("HandleZAxis", value)End SetEnd Property''' <summary>''' 【線性尺寸】【角度尺寸】【半徑尺寸】手柄原點''' </summary>''' <value></value>''' <returns></returns>''' <remarks></remarks>Public Property HandleOrigin As NXOpen.Point3dGetReturn Me.ower.GetProperties.GetPoint("HandleOrigin")End GetSet(ByVal value As NXOpen.Point3d)Me.ower.GetProperties.SetPoint("HandleOrigin", value)End SetEnd Property''' <summary>''' 【線性尺寸】【角度尺寸】【半徑尺寸】【軌跡上的尺寸(沿曲線的位置)】顯示焦點手柄''' </summary>''' <value></value>''' <returns></returns>''' <remarks></remarks>Public Property ShowFocusHandle As BooleanGetReturn Me.ower.GetProperties.GetLogical("ShowFocusHandle")End GetSet(ByVal value As Boolean)Me.ower.GetProperties.SetLogical("ShowFocusHandle", value)End SetEnd Property''' <summary>''' 【線性尺寸】【角度尺寸】【半徑尺寸】顯示手柄''' </summary>''' <value></value>''' <returns></returns>''' <remarks></remarks>Public Property ShowHandle As BooleanGetReturn Me.ower.GetProperties.GetLogical("ShowHandle")End GetSet(ByVal value As Boolean)Me.ower.GetProperties.SetLogical("ShowHandle", value)End SetEnd Property#End Region''' <summary>''' 【String】字符串值''' </summary>''' <value></value>''' <returns></returns>''' <remarks></remarks>Public Property StringValue As StringGetReturn Me.ower.GetProperties.GetString("Value")End GetSet(ByVal value As String)Me.ower.GetProperties.SetString("Value", value)End SetEnd PropertyPublic Property StringArrayValue As String()GetReturn Me.ower.GetProperties.GetStrings("Value")End GetSet(ByVal value As String())Me.ower.GetProperties.SetStrings("Value", value)End SetEnd PropertyPublic Property IntegerValue As IntegerGetReturn Me.ower.GetProperties.GetInteger("Value")End GetSet(ByVal value As Integer)Me.ower.GetProperties.SetInteger("Value", value)End SetEnd PropertyPublic Property DoubleValue As DoubleGetReturn Me.ower.GetProperties.GetDouble("Value")End GetSet(ByVal value As Double)Me.ower.GetProperties.SetDouble("Value", value)End SetEnd Property#Region "Selection with Browse"''' <summary>''' 指定選擇文件或文件夾的路徑 ''' </summary>''' <value></value>''' <returns></returns>''' <remarks>任何代表有效的文件路徑或文件夾路徑的字符串。</remarks>Public Property Path As StringGetReturn Me.ower.GetProperties.GetString("Path")End GetSet(ByVal value As String)Me.ower.GetProperties.SetString("Path", value)End SetEnd Property''' <summary>''' 指定篩選器的格式為"*.txt,*.xml"。如果未設(shè)置此屬性,嵌以.prt作為默認(rèn)的過濾器。''' </summary>''' <value></value>''' <returns></returns>''' <remarks>字符串值的格式為"*.txt,*.xml"。如果空白,則以.prt作為默認(rèn)的過濾器。</remarks>Public Property Filter As StringGetReturn Me.ower.GetProperties.GetString("Filter")End GetSet(ByVal value As String)Me.ower.GetProperties.SetString("Filter", value)End SetEnd Property#End RegionEnd Class End Namespace轉(zhuǎn)載于:https://www.cnblogs.com/bizca/p/4964329.html
總結(jié)
以上是生活随笔為你收集整理的NXOpen.BlockStyler的一些用法的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 减少C++代码编译时间的方法
- 下一篇: HDU 4336 概率DP 状压