×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Journal (.NET) Remove Parameters Command

Journal (.NET) Remove Parameters Command

Journal (.NET) Remove Parameters Command

(OP)
Hello, would it be possible to modify the program below in order to remove parameters to any oject (solids, surfaces, curves and points) in the part file ?
Thank you


Sample NXOpen .NET Visual Basic program to remove parameters from all bodies in work part

Option Strict Off  

Imports System
Imports NXOpen
Imports NXOpen.UF
Imports NXOpen.UI
Imports NXOpen.Utilities

Module remove_parameters_from_all_bodies_in_work_part

  Dim s As Session = Session.GetSession()
  Dim ufs As UFSession = UFSession.GetUFSession()

Sub Main()

    Dim workPart As Part = s.Parts.Work
    Dim myBodies As NXOpen.BodyCollection = workPart.Bodies
    Dim bodytag(0) As NXOpen.Tag
    Dim a_body As Body

    For Each a_body In myBodies
        bodytag(0) = a_body.Tag
        ufs.Modl.DeleteObjectParms(bodytag)
    Next

End Sub

  Public Function GetUnloadOption(ByVal dummy As String) As Integer
      GetUnloadOption = UFConstants.UF_UNLOAD_IMMEDIATELY
  End Function

End Module

Sandro Anderlini
Mould designer
Macerata - Italy

RE: Journal (.NET) Remove Parameters Command

Yes, DeleteObjectParams() can do what you want. The GTAC example you posted will all ready remove parameters for sheets and solids so all thats missing is points and curves. A quick and dirty solution would be something like this,

CODE

Option Strict On

Imports System
Imports NXOpen
Imports NXOpen.UF
Imports NXOpen.UI
Imports NXOpen.Utilities

Module remove_parameters_from_all_bodies_in_work_part
    Dim s As Session = Session.GetSession()
    Dim ufs As UFSession = UFSession.GetUFSession()

    Sub Main()
        Dim workPart As Part = s.Parts.Work
        Dim objectTag(0) As NXOpen.Tag

        Dim a_point As Point
        Dim a_curve As Curve
        Dim a_body As Body

        For Each a_point In workPart.Points
            objectTag(0) = a_point.Tag
            ufs.Modl.DeleteObjectParms(objectTag)
        Next

        For Each a_curve In workPart.Curves
            objectTag(0) = a_curve.Tag
            ufs.Modl.DeleteObjectParms(objectTag)
        Next

        For Each a_body In workPart.Bodies
            objectTag(0) = a_body.Tag
            ufs.Modl.DeleteObjectParms(objectTag)
        Next
    End Sub

    Public Function GetUnloadOption(ByVal dummy As String) As Integer
        GetUnloadOption = UFConstants.UF_UNLOAD_IMMEDIATELY
    End Function

End Module

// Petter

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources