Cancel
Showing results for 
Search instead for 
Did you mean: 

Importing JT assemblies

Experimenter
Experimenter

Hi,

I am investigating NX as a possible replacement for Inventor.

One significant issue is being able to import legacy data.

Currently I am importing a JT file containing the assembly which works reasonably well apart from a couple of issues.

Firstly, I don't seem to be able to specify where the imported files are located, they just end up in the directory that the JT files are in. Is there a way to specify a destination folder? This is a part of the standard import settings in Inventor and it would be useful to be able to control how data is imported.

Secondly, all the files now have the suffix '_jt' added which is not wanted as we require the part numbers to remain the same.

Any ideas anyone?

Cheers

Nick

Lead Design Engineer
IHC Engineering Business Ltd
3 REPLIES

Re: Importing JT assemblies

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

Importing jt files will result in a faceted body in NX, which isn't much use other than for visualization. If you need to make use of the imported geometry, I suggest using the STEP format.

Re: Importing JT assemblies

Experimenter
Experimenter

I beg to differ - we have been looking at the best data transfer method to use between Inventor and NX & Solid Edge and JT is better than Step.

We get files in that are identical in shape to the originals; you do have to export as Brep only, not Brep and Facets or Facets only.

Lead Design Engineer
IHC Engineering Business Ltd

Re: Importing JT assemblies

Siemens Phenom Siemens Phenom
Siemens Phenom

There is no control over name of parts while exporting as JT. The suffix "_jt" will be added to the all part names of assembly. You can try the following journal code, It will rename the part names by removing suffix"_jt"

 

Option Strict Off
Imports System
Imports System.Collections
Imports NXOpen
Imports NXOpen.UF
Imports NXOpen.UI
Imports NXOpen.Utilities

Module removes_suffix_jt_in_assembly_part_names

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

Sub Main()

Dim dispPart As Part = s.Parts.Display()
Dim allParts() As Part = s.Parts.ToArray()
Dim pieceParts As New ArrayList
Dim assyParts As New ArrayList

For Each thisPart As Part In allParts
Dim thisTag As NXOpen.Tag = ufs.Assem.AskRootPartOcc(thisPart.Tag)

If thisTag = NXOpen.Tag.Null Then
pieceParts.Add(thisPart)
Else
assyParts.Add(thisPart)
End If

Next

'========== Piece parts must be processed first.

lw.Open()
lw.WriteLine("Piece parts found: " & pieceParts.Count.ToString())

For inx As Integer = 0 To pieceParts.Count - 1
Dim aPart As NXOpen.Part = pieceParts(inx)
Dim oldPath As String = aPart.FullPath()
Dim lastSlash As Integer = oldPath.LastIndexOf("\")
Dim oldShortName As String = oldPath.Substring(lastSlash)

lw.WriteLine(inx.ToString() & ". Original : " & oldPath)
Dim newShortName As String = oldShortName.Replace("_jt", "")
Dim newName As String = oldPath.Replace(oldShortName, newShortName)

If oldShortName <> newShortName Then

lw.WriteLine(" Saving As: " & newName)

Dim saveStatus As PartSaveStatus = Nothing
saveStatus = aPart.SaveAs(newName)
Else
lw.WriteLine(" Not Saving: " & newName)
End If
Next

lw.WriteLine("======================================================")
lw.WriteLine(" ")

'========== Then the assembly parts can be processed.

lw.WriteLine("Assembly parts found:" & assyParts.Count.ToString())

For inx As Integer = 0 To assyParts.Count - 1
Dim aPart As NXOpen.Part = assyParts(inx)
Dim oldPath As String = aPart.FullPath()
Dim lastSlash As Integer = oldPath.LastIndexOf("\")
Dim oldShortName As String = oldPath.Substring(lastSlash)

lw.WriteLine(inx.ToString() & ". Original : " & oldPath)
Dim newShortName As String = oldShortName.Replace("_jt", "")
Dim newName As String = oldPath.Replace(oldShortName, newShortName)

If oldShortName <> newShortName Then

lw.WriteLine(" Saving As: " & newName)

Dim saveStatus As PartSaveStatus = Nothing
saveStatus = aPart.SaveAs(newName)
Else
lw.WriteLine(" Not Saving: " & newName)
End If

Next

End Sub

Public Function GetUnloadOption(ByVal dummy As String) As Integer
Return Session.LibraryUnloadOption.Immediately
End Function

End Module