Martin898989
Mechanical
- Sep 27, 2016
- 14
Hi,
I have created this attribute. Any chance to delete it? Thank you
I have created this attribute. Any chance to delete it? Thank you
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Option Strict On
Imports System
Imports NXOpen
Imports NXOpen.UF
Imports NXOpenUI
Module Unlock
Private text As String
Dim s As Session = Session.GetSession()
Dim ufs As UFSession = UFSession.GetUFSession()
Sub Main()
Dim theSession As Session = Session.GetSession()
Dim workPart As Part = theSession.Parts.Work
Dim displayPart As Part = theSession.Parts.Display
If workPart Is Nothing Then Return
Dim markId1 As Session.UndoMarkId
markId1 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Unlock")
' ----------------------------------------------
Dim p As BasePart = workPart
If Not SelectText() Then
Return
End If
Try
p.SetUserAttributeLock(text, NXObject.AttributeType.Any, False)
Catch ex As Exception
End Try
End Sub
Function SelectText() As Boolean
Dim theSession As Session = Session.GetSession()
Dim workPart As Part = theSession.Parts.Work
Dim theUISession As UI = UI.GetUI
Dim answer As String = ""
SelectText = False
text = InputBox("Digite a Propriedade para Unlock", "UNLOCK Properties", "")
'text = NXInputBox.GetInputString("prompt", "title bar caption", "initial text")
If text.Length <> 0 Then
SelectText = True
End If
End Function
Public Function GetUnloadOption(ByVal dummy As String) As Integer
'Unloads the image when the NX session terminates
GetUnloadOption = NXOpen.Session.LibraryUnloadOption.Immediately
End Function
End Module