Journaling Generic FindObject
Journaling Generic FindObject
(OP)
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





RE: Journaling Generic FindObject
https://solutions.industrysoftware.automation.siem...
RE: Journaling Generic FindObject
www.nxjournaling.com
RE: Journaling Generic FindObject
RE: Journaling Generic FindObject
CODE
Option Strict Off Imports System Imports NXOpen Module Module28 Dim theSession As Session = Session.GetSession() Dim workPart As Part = theSession.Parts.Work Sub Main() 'find flat pattern feature For Each tempFeature As Features.Feature In workPart.Features If TypeOf (tempFeature) Is Features.FlatPattern Then 'found it! ExportTrumpf(workPart.FullPath.Substring(0, workPart.FullPath.Length - 4) & ".geo", tempFeature) Exit For End If Next End Sub Sub ExportTrumpf(ByVal exportFileName As String, ByVal flatPattern As Features.FlatPattern) Dim exportTrumpfBuilder1 As Features.SheetMetal.ExportTrumpfBuilder exportTrumpfBuilder1 = Workpart.Features.SheetmetalManager.CreateExportTrumpfBuilder() exportTrumpfBuilder1.OutputGeoFile = exportFileName exportTrumpfBuilder1.InteriorCutout = True exportTrumpfBuilder1.SelectFlatPattern.Value = flatPattern Dim nXObject1 As NXObject nXObject1 = exportTrumpfBuilder1.Commit() exportTrumpfBuilder1.Destroy() End Sub End Modulewww.nxjournaling.com
RE: Journaling Generic FindObject
RE: Journaling Generic FindObject
Is the Getting Started with SNAP guide part of the NX help files or do I need to download that from GTAC?