Ehaviv
Computer
- Jul 2, 2003
- 1,012
Hi
The following journal run ok
but when compiling to dll throw this error
"DeleteUserAttributes not belong to NXObject"
and in nx85 reference show is belong
DeleteUserAttributes Method (type, option)
Namespaces ► NXOpen ► NXObject ► DeleteUserAttributes(NXObject.AttributeType,Update.Option)
The code:
Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.Utilities
Imports NXOpen.UF
Module delete_body_attributes
Sub Main()
Dim s As Session = Session.GetSession()
Dim lw As ListingWindow = s.ListingWindow()
Dim ufs As UFSession = UFSession.GetUFSession()
Dim markId1 As Session.UndoMarkId
markId1 = s.SetUndoMark(Session.MarkVisibility.Visible, "Report Body Attributes")
lw.Open()
ufs.Ui.ExitListingWindow() ' Clear and close the window
For each body1 As Body in s.Parts.Display.Bodies
Dim body_object As NXObject = body1
Try
body_object.DeleteUserAttributes(NXObject.AttributeType.String, Update.Option.Now)
Catch ex As Exception
lw.WriteLine("Exception Error = " &ex.ToString())
End Try
Next
MsgBox("All Bodies String Attribute Type * Deleted * ")
End Sub
Public Function GetUnloadOption(ByVal dummy As String) As Integer
GetUnloadOption = UFConstants.UF_UNLOAD_IMMEDIATELY
End Function
End Module
The following journal run ok
but when compiling to dll throw this error
"DeleteUserAttributes not belong to NXObject"
and in nx85 reference show is belong
DeleteUserAttributes Method (type, option)
Namespaces ► NXOpen ► NXObject ► DeleteUserAttributes(NXObject.AttributeType,Update.Option)
The code:
Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.Utilities
Imports NXOpen.UF
Module delete_body_attributes
Sub Main()
Dim s As Session = Session.GetSession()
Dim lw As ListingWindow = s.ListingWindow()
Dim ufs As UFSession = UFSession.GetUFSession()
Dim markId1 As Session.UndoMarkId
markId1 = s.SetUndoMark(Session.MarkVisibility.Visible, "Report Body Attributes")
lw.Open()
ufs.Ui.ExitListingWindow() ' Clear and close the window
For each body1 As Body in s.Parts.Display.Bodies
Dim body_object As NXObject = body1
Try
body_object.DeleteUserAttributes(NXObject.AttributeType.String, Update.Option.Now)
Catch ex As Exception
lw.WriteLine("Exception Error = " &ex.ToString())
End Try
Next
MsgBox("All Bodies String Attribute Type * Deleted * ")
End Sub
Public Function GetUnloadOption(ByVal dummy As String) As Integer
GetUnloadOption = UFConstants.UF_UNLOAD_IMMEDIATELY
End Function
End Module