CaseNTray
Mechanical
- Jan 9, 2012
- 10
I have created a journal to export geo files for our sheet metal parts, but I need to make it generic so I can run it on different parts. I’ve been looking thru here the past couple of days trying to find specifics on how to accomplish this with no success, several threads come close but I am not able to cross I’s & dot T’s. In this example I know I need to change "FLAT_PATTERN(10)" to something generic and I would like it to export the geo file name as the part file name. Is there a source that someone can recommend for specific journaling details? Thanks!
' NX 7.5.5.4
' Journal created by bradg on Fri Feb 13 14:19:30 2015 Eastern Standard Time
'
Option Strict Off
Imports System
Imports NXOpen
Module NXJournal
Sub Main
Dim theSession As Session = Session.GetSession()
Dim workPart As Part = theSession.Parts.Work
Dim displayPart As Part = theSession.Parts.Display
' ----------------------------------------------
' Menu: Insert->Flat Pattern->Export Trumpf GEO File
' ----------------------------------------------
Dim markId1 As Session.UndoMarkId
markId1 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Start")
Dim exportTrumpfBuilder1 As Features.SheetMetal.ExportTrumpfBuilder
exportTrumpfBuilder1 = workPart.Features.SheetmetalManager.CreateExportTrumpfBuilder()
exportTrumpfBuilder1.OutputGeoFile = "C:\DXF\model0.geo"
exportTrumpfBuilder1.InteriorCutout = True
theSession.SetUndoMarkName(markId1, "Export Trumpf GEO File Dialog")
Dim flatPattern1 As Features.FlatPattern = CType(workPart.Features.FindObject("FLAT_PATTERN(10)"), Features.FlatPattern)
exportTrumpfBuilder1.SelectFlatPattern.Value = flatPattern1
Dim markId2 As Session.UndoMarkId
markId2 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Export Trumpf GEO File")
Dim nXObject1 As NXObject
nXObject1 = exportTrumpfBuilder1.Commit()
theSession.DeleteUndoMark(markId2, Nothing)
theSession.SetUndoMarkName(markId1, "Export Trumpf GEO File")
exportTrumpfBuilder1.Destroy()
' ----------------------------------------------
' Menu: Tools->Journal->Stop Recording
' ----------------------------------------------
End Sub
End Module
' NX 7.5.5.4
' Journal created by bradg on Fri Feb 13 14:19:30 2015 Eastern Standard Time
'
Option Strict Off
Imports System
Imports NXOpen
Module NXJournal
Sub Main
Dim theSession As Session = Session.GetSession()
Dim workPart As Part = theSession.Parts.Work
Dim displayPart As Part = theSession.Parts.Display
' ----------------------------------------------
' Menu: Insert->Flat Pattern->Export Trumpf GEO File
' ----------------------------------------------
Dim markId1 As Session.UndoMarkId
markId1 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Start")
Dim exportTrumpfBuilder1 As Features.SheetMetal.ExportTrumpfBuilder
exportTrumpfBuilder1 = workPart.Features.SheetmetalManager.CreateExportTrumpfBuilder()
exportTrumpfBuilder1.OutputGeoFile = "C:\DXF\model0.geo"
exportTrumpfBuilder1.InteriorCutout = True
theSession.SetUndoMarkName(markId1, "Export Trumpf GEO File Dialog")
Dim flatPattern1 As Features.FlatPattern = CType(workPart.Features.FindObject("FLAT_PATTERN(10)"), Features.FlatPattern)
exportTrumpfBuilder1.SelectFlatPattern.Value = flatPattern1
Dim markId2 As Session.UndoMarkId
markId2 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Export Trumpf GEO File")
Dim nXObject1 As NXObject
nXObject1 = exportTrumpfBuilder1.Commit()
theSession.DeleteUndoMark(markId2, Nothing)
theSession.SetUndoMarkName(markId1, "Export Trumpf GEO File")
exportTrumpfBuilder1.Destroy()
' ----------------------------------------------
' Menu: Tools->Journal->Stop Recording
' ----------------------------------------------
End Sub
End Module