Herbymusic
Automotive
- Nov 21, 2014
- 4
Hi everybody,
I want to delete a part attribute in NX9, but this is locked.
Are there any suggestions ?
I want to delete a part attribute in NX9, but this is locked.
Are there any suggestions ?
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 Off
Imports System
Imports NXOpen
Imports NXOpen.UF
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
' ----------------------------------------------
' Menu: File->Properties
' ----------------------------------------------
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 = ""
text = InputBox("Digite a Propriedade para Unlock", "UNLOCK Properties", "")
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.AtTermination
End Function
End Module