×
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

GRIP command to export parasolid

GRIP command to export parasolid

GRIP command to export parasolid

(OP)
Hi, I need some help

How to export a parasolid from the existing part file using GRIP programming ?

The only command that I found is CPATT/ and it exports .prt file

thank you

RE: GRIP command to export parasolid

Just curious, why GRIP and not a journal?

Kevin

RE: GRIP command to export parasolid

(OP)

Because my supervisor loves GRIP :p

Is it more simple with a journal ? I mean do you advice me to lean how to proceed with journaling ? Therefore,I have to convince him ;)

thank you

kader

RE: GRIP command to export parasolid

My experience is that journal transition to new releases of NX without issue, I am not sure if GRIP macros do. The journals I write are what I believe would be considered simple too though.
I also think you will find more support for journaling(VB)

Portion of a Journal for exporting parasolid:

Option Strict Off
Imports System
Imports System.IO
Imports NXOpen
Imports NXOpen.UF
Imports NXOpenUI
Imports System.Collections.Generic

Module NXJournal

Dim theSession As Session = Session.GetSession()
Dim ufs As UFSession = UFSession.GetUFSession()
Dim workPart As Part = theSession.Parts.Work
Dim displayPart As Part = theSession.Parts.Display
Dim lw As ListingWindow = theSession.ListingWindow



Sub Main
Const bodyLayer As Integer = 1
Const bodyLayer79 As Integer = 79
Dim myOptions As UFPart.ExportOptions
myOptions.params_mode = UFPart.ExportParamsMode.RemoveParams
myOptions.new_part = True

Dim partName As String = (GetFilePath+GetFileName+".x_t")
Dim objectTags As New List(Of Tag)
Dim objectTags79 As New List(Of Tag)

' Determine whether the directory exists.


'collect bodies from layer 1
For Each myObj As Body In workPart.Bodies
If myObj.Layer = bodyLayer Then
objectTags.Add(myObj.Tag)
End If
Next
'collect bodies from layer 79
lw.open
For Each myObj As Body In workPart.Bodies
If myObj.Layer = bodyLayer79 Then
objectTags.Add(myObj.Tag)
End If
Next
If objectTags.Count = 0 Then
msgbox("There Are No Objects On Layer 1")
Exit Sub
End If
' Determine whether the directory exists.
Dim di As DirectoryInfo = New DirectoryInfo(GetFilePath)
If di.Exists Then
'msgbox("That path exists already.")
lw.WriteLine(partName)
'lw.WriteLine("Under Construction")
Else
' Try to create the directory.
di.Create()
lw.WriteLine(partName)
'lw.WriteLine("Under Construction")
End If
ufs.Ps.ExportData(objectTags.ToArray, partName)

lw.close

End Sub

RE: GRIP command to export parasolid

There are NO GRIP commands which support Parasolid operations including exporting models. The best that you could do is create an NX Open function that does support exporting a Parasolid file and call that from the GRIP program, but that's a bit obtuse considering the more modern tools that are now available.

That being said, I do need to clear up a few things. To start with with DO NOT confuse GRIP with Macros. GRIP is a true, albeit proprietary to UG/NX, programming language. And older GRIP programs will still run with newer versions of NX. In fact, I have a GRIP program that was written over 35 years ago that still runs today with the latest version of NX. Not one line of code has been changed. All I had to do was recompile and link it and it ran first time, performing the exact task that it was created for back in 1978 when I originally wrote it.

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Digital Factory
Cypress, CA
Siemens PLM:
UG/NX Museum:

To an Engineer, the glass is twice as big as it needs to be.

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