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
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
Kevin
RE: GRIP command to export parasolid
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
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
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.
RE: GRIP command to export parasolid
aek16, I found this thread you may be interested in: thread561-282269: GRIP versus Journal
Kevin