Edit MoldBase Information in Create MoldBase

Hello,
In the process of creating Moldbase, I want to edit the information according to the BITMAP interface I created. But after using Jounaling record and playing it again, I get this error message:
"NXOpen.NXException: No object found with this name
at NXOpen.PartCollection.FindOject (String name)
at NXJournal.Main (String [] args) in C: \ Users \ Dell \ AppData \ Local \ Temp \ NXJournals33032 \ journal0.vb: line279 "
Please tell me what problem am I having? If anyone is working on an equivalent topic please share it for me so I can do it? Thanks so much
The code I have recorded below:

' NX 12.0.0.27
' Journal created by DELL on Thu Feb 6 17:46:36 2020 SE Asia Standard Time
'
Imports System
Imports NXOpen

Module NXJournal
Sub Main (ByVal args() As String)

Dim theSession As NXOpen.Session = NXOpen.Session.GetSession()
Dim workPart As NXOpen.Part = theSession.Parts.Work

Dim displayPart As NXOpen.Part = theSession.Parts.Display

' ----------------------------------------------
' Menu: Tools->Process Specific->Mold Wizard->Mold Base Library...
' ----------------------------------------------
Dim markId1 As NXOpen.Session.UndoMarkId = Nothing
markId1 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Visible, "Start")

Dim standardPartBuilder1 As NXOpen.Tooling.StandardPartBuilder = Nothing
standardPartBuilder1 = workPart.ToolingManager.StandardPart.CreateStandardPartBuilder()

Dim spreadsheetData1 As NXOpen.Tooling.SpreadsheetData = Nothing
spreadsheetData1 = theSession.ToolingSession.CreateSpreadsheetData()

standardPartBuilder1.ShowInfoWindow = True

standardPartBuilder1.AssociativePosition = True

standardPartBuilder1.RenameComponents = True

theSession.SetUndoMarkName(markId1, "Mold Base Library Dialog")

spreadsheetData1.ReadData("")

spreadsheetData1.ReadData("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\de_series.xlsx::FUTABA")

spreadsheetData1.ReadData("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\de_series.xlsx::FUTABA")

standardPartBuilder1.RenameComponents = False

Dim markId2 As NXOpen.Session.UndoMarkId = Nothing
markId2 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Invisible, "Mold Base Library")

theSession.DeleteUndoMark(markId2, Nothing)

Dim markId3 As NXOpen.Session.UndoMarkId = Nothing
markId3 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Invisible, "Mold Base Library")

Dim addReusablePart1 As NXOpen.Tooling.AddReusablePart = Nothing
addReusablePart1 = workPart.ReusableParts.CreateBuilder()

Dim cloneObject1 As NXOpen.Tooling.CloneObject = Nothing
cloneObject1 = addReusablePart1.CreateCloneObject(NXOpen.Tooling.ToolingApplication.MoldWizard, "C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\fd.prt")

cloneObject1.CloneMethod = NXOpen.Tooling.ToolingClonemethod.Rename

cloneObject1.SetProjectName("proj")

cloneObject1.OutputFolder = ""

cloneObject1.SyncPartNumber()

cloneObject1.AddAssembly("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\fd.prt")

cloneObject1.BuildAllClonePartItems()

Dim clonedpartname1 As String = Nothing
clonedpartname1 = cloneObject1.Commit()

cloneObject1.SyncPartNumber()

cloneObject1.Dispose()
addReusablePart1.Destroy()

Dim part1 As NXOpen.Part = CType(theSession.Parts.FindObject("proj_fd_781"), NXOpen.Part)

Dim basePoint1 As NXOpen.Point3d = New NXOpen.Point3d(0.0, 0.0, 0.0)
Dim orientation1 As NXOpen.Matrix3x3 = Nothing
orientation1.Xx = 1.0
orientation1.Xy = 0.0
orientation1.Xz = 0.0
orientation1.Yx = 0.0
orientation1.Yy = 1.0
orientation1.Yz = 0.0
orientation1.Zx = 0.0
orientation1.Zy = 0.0
orientation1.Zz = 1.0
Dim partLoadStatus1 As NXOpen.PartLoadStatus = Nothing
Dim component1 As NXOpen.Assemblies.Component = Nothing
component1 = workPart.ComponentAssembly.AddComponent(part1, Nothing, "MOLD BASE", basePoint1, orientation1, -1, partLoadStatus1)

partLoadStatus1.Dispose()
theSession.DeleteUndoMark(markId3, Nothing)

workPart = theSession.Parts.Work ' TestFillSurface
theSession.SetUndoMarkName(markId1, "Mold Base Library")

standardPartBuilder1.Destroy()

spreadsheetData1.Dispose()
Dim components1(0) As NXOpen.Assemblies.Component
components1(0) = component1
component1.UpdateStructure(components1, 2, True)

Dim component2 As NXOpen.Assemblies.Component = CType(component1.FindObject("COMPONENT proj_movehalf_773 1"), NXOpen.Assemblies.Component)

Dim components2(0) As NXOpen.Assemblies.Component
components2(0) = component2
component2.UpdateStructure(components2, 2, True)

Dim component3 As NXOpen.Assemblies.Component = CType(component1.FindObject("COMPONENT proj_fixhalf_769 1"), NXOpen.Assemblies.Component)

Dim components3(0) As NXOpen.Assemblies.Component
components3(0) = component3
component3.UpdateStructure(components3, 2, True)

' ----------------------------------------------
' Menu: Tools->Journal->Stop Recording
' ----------------------------------------------

End Sub
End Module

The error message posted indicates an error in line 279 when "NXOpen.PartCollection.FindOject" is called. However, the code posted does not have 279 lines nor does it contain a call to that function; I think the error is in some other code that you have running.

That said, the PartCollection maintains the list of currently open parts in your NX session. I'd guess that after the code was recorded (or during) a part was closed. When you re-run the code, it is looking for that part, but cannot find it.

Really sorry for my confusion.
Line 279 is "Dim part1 As NXOpen.Part = CType(theSession.Parts.FindObject("proj_fd_656"), NXOpen.Part) "

i send you my new record. If you have any sample code related can you please share it with me?

<' NX 12.0.0.27
' Journal created by DELL on Thu Feb 6 17:16:04 2020 SE Asia Standard Time
'
Imports System
Imports NXOpen

Module NXJournal
Sub Main (ByVal args() As String)

Dim theSession As NXOpen.Session = NXOpen.Session.GetSession()
Dim workPart As NXOpen.Part = theSession.Parts.Work

Dim displayPart As NXOpen.Part = theSession.Parts.Display

' ----------------------------------------------
' Menu: Tools->Process Specific->Mold Wizard->Mold Base Library...
' ----------------------------------------------
Dim markId1 As NXOpen.Session.UndoMarkId = Nothing
markId1 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Visible, "Start")

Dim standardPartBuilder1 As NXOpen.Tooling.StandardPartBuilder = Nothing
standardPartBuilder1 = workPart.ToolingManager.StandardPart.CreateStandardPartBuilder()

Dim spreadsheetData1 As NXOpen.Tooling.SpreadsheetData = Nothing
spreadsheetData1 = theSession.ToolingSession.CreateSpreadsheetData()

standardPartBuilder1.ShowInfoWindow = True

standardPartBuilder1.AssociativePosition = True

standardPartBuilder1.RenameComponents = True

theSession.SetUndoMarkName(markId1, "Mold Base Library Dialog")

spreadsheetData1.ReadData("")

spreadsheetData1.ReadData("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\de_series.xlsx::FUTABA")

spreadsheetData1.ReadData("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\de_series.xlsx::FUTABA")

spreadsheetData1.SelectPrimaryParameter("index", "1820")

Dim markId2 As NXOpen.Session.UndoMarkId = Nothing
markId2 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Invisible, "Mold Base Library")

theSession.DeleteUndoMark(markId2, Nothing)

Dim markId3 As NXOpen.Session.UndoMarkId = Nothing
markId3 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Invisible, "Mold Base Library")

Dim addReusablePart1 As NXOpen.Tooling.AddReusablePart = Nothing
addReusablePart1 = workPart.ReusableParts.CreateBuilder()

Dim cloneObject1 As NXOpen.Tooling.CloneObject = Nothing
cloneObject1 = addReusablePart1.CreateCloneObject(NXOpen.Tooling.ToolingApplication.MoldWizard, "C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\fd.prt")

cloneObject1.CloneMethod = NXOpen.Tooling.ToolingClonemethod.Rename

cloneObject1.SetProjectName("proj")

cloneObject1.OutputFolder = ""

cloneObject1.SyncPartNumber()

cloneObject1.AddAssembly("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\fd.prt")

cloneObject1.BuildAllClonePartItems()

Dim markId4 As NXOpen.Session.UndoMarkId = Nothing
markId4 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Invisible, "Start")

theSession.SetUndoMarkName(markId4, "Part Name Management Dialog")

Dim clonePart1 As NXOpen.Tooling.ClonePart = Nothing
clonePart1 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\fd.prt")

Dim clonePart2 As NXOpen.Tooling.ClonePart = Nothing
clonePart2 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\movehalf.prt")

Dim clonePart3 As NXOpen.Tooling.ClonePart = Nothing
clonePart3 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\m_rpn.prt")

Dim clonePart4 As NXOpen.Tooling.ClonePart = Nothing
clonePart4 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\m_rpn.prt")

Dim clonePart5 As NXOpen.Tooling.ClonePart = Nothing
clonePart5 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\m_rpn.prt")

Dim clonePart6 As NXOpen.Tooling.ClonePart = Nothing
clonePart6 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\m_rpn.prt")

Dim clonePart7 As NXOpen.Tooling.ClonePart = Nothing
clonePart7 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\m_gpa.prt")

Dim clonePart8 As NXOpen.Tooling.ClonePart = Nothing
clonePart8 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\m_gpa.prt")

Dim clonePart9 As NXOpen.Tooling.ClonePart = Nothing
clonePart9 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\m_gpa.prt")

Dim clonePart10 As NXOpen.Tooling.ClonePart = Nothing
clonePart10 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\m_gpa.prt")

Dim clonePart11 As NXOpen.Tooling.ClonePart = Nothing
clonePart11 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\m_gbb.prt")

Dim clonePart12 As NXOpen.Tooling.ClonePart = Nothing
clonePart12 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\m_gbb.prt")

Dim clonePart13 As NXOpen.Tooling.ClonePart = Nothing
clonePart13 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\m_gbb.prt")

Dim clonePart14 As NXOpen.Tooling.ClonePart = Nothing
clonePart14 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\m_gbb.prt")

Dim clonePart15 As NXOpen.Tooling.ClonePart = Nothing
clonePart15 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\m_gba_2.prt")

Dim clonePart16 As NXOpen.Tooling.ClonePart = Nothing
clonePart16 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\m_gba_2.prt")

Dim clonePart17 As NXOpen.Tooling.ClonePart = Nothing
clonePart17 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\m_gba_2.prt")

Dim clonePart18 As NXOpen.Tooling.ClonePart = Nothing
clonePart18 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\m_gba_2.prt")

Dim clonePart19 As NXOpen.Tooling.ClonePart = Nothing
clonePart19 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\l_plate.prt")

Dim clonePart20 As NXOpen.Tooling.ClonePart = Nothing
clonePart20 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\f_plate.prt")

Dim clonePart21 As NXOpen.Tooling.ClonePart = Nothing
clonePart21 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\e_plate.prt")

Dim clonePart22 As NXOpen.Tooling.ClonePart = Nothing
clonePart22 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\cr_plate.prt")

Dim clonePart23 As NXOpen.Tooling.ClonePart = Nothing
clonePart23 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\cl_plate.prt")

Dim clonePart24 As NXOpen.Tooling.ClonePart = Nothing
clonePart24 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\b_plate.prt")

Dim clonePart25 As NXOpen.Tooling.ClonePart = Nothing
clonePart25 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\u_plate.prt")

Dim clonePart26 As NXOpen.Tooling.ClonePart = Nothing
clonePart26 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\screw_pll.prt")

Dim clonePart27 As NXOpen.Tooling.ClonePart = Nothing
clonePart27 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\screw_pll.prt")

Dim clonePart28 As NXOpen.Tooling.ClonePart = Nothing
clonePart28 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\screw_pll.prt")

Dim clonePart29 As NXOpen.Tooling.ClonePart = Nothing
clonePart29 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\screw_pll.prt")

Dim clonePart30 As NXOpen.Tooling.ClonePart = Nothing
clonePart30 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\screw_pll.prt")

Dim clonePart31 As NXOpen.Tooling.ClonePart = Nothing
clonePart31 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\screw_pll.prt")

Dim clonePart32 As NXOpen.Tooling.ClonePart = Nothing
clonePart32 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\screw_ej.prt")

Dim clonePart33 As NXOpen.Tooling.ClonePart = Nothing
clonePart33 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\screw_ej.prt")

Dim clonePart34 As NXOpen.Tooling.ClonePart = Nothing
clonePart34 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\screw_ej.prt")

Dim clonePart35 As NXOpen.Tooling.ClonePart = Nothing
clonePart35 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\screw_ej.prt")

Dim clonePart36 As NXOpen.Tooling.ClonePart = Nothing
clonePart36 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\s_plate.prt")

Dim clonePart37 As NXOpen.Tooling.ClonePart = Nothing
clonePart37 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\fixhalf.prt")

Dim clonePart38 As NXOpen.Tooling.ClonePart = Nothing
clonePart38 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\a_plate.prt")

Dim clonePart39 As NXOpen.Tooling.ClonePart = Nothing
clonePart39 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\t_plate.prt")

Dim clonePart40 As NXOpen.Tooling.ClonePart = Nothing
clonePart40 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\r_plate.prt")

Dim clonePart41 As NXOpen.Tooling.ClonePart = Nothing
clonePart41 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\m_spn.prt")

Dim clonePart42 As NXOpen.Tooling.ClonePart = Nothing
clonePart42 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\m_spn.prt")

Dim clonePart43 As NXOpen.Tooling.ClonePart = Nothing
clonePart43 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\m_spn.prt")

Dim clonePart44 As NXOpen.Tooling.ClonePart = Nothing
clonePart44 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\m_spn.prt")

Dim clonePart45 As NXOpen.Tooling.ClonePart = Nothing
clonePart45 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\m_gpa_1.prt")

Dim clonePart46 As NXOpen.Tooling.ClonePart = Nothing
clonePart46 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\m_gpa_1.prt")

Dim clonePart47 As NXOpen.Tooling.ClonePart = Nothing
clonePart47 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\m_gpa_1.prt")

Dim clonePart48 As NXOpen.Tooling.ClonePart = Nothing
clonePart48 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\m_gpa_1.prt")

Dim clonePart49 As NXOpen.Tooling.ClonePart = Nothing
clonePart49 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\m_gbb_spn.prt")

Dim clonePart50 As NXOpen.Tooling.ClonePart = Nothing
clonePart50 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\m_gbb_spn.prt")

Dim clonePart51 As NXOpen.Tooling.ClonePart = Nothing
clonePart51 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\m_gbb_spn.prt")

Dim clonePart52 As NXOpen.Tooling.ClonePart = Nothing
clonePart52 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\m_gbb_spn.prt")

Dim clonePart53 As NXOpen.Tooling.ClonePart = Nothing
clonePart53 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\m_gba_1.prt")

Dim clonePart54 As NXOpen.Tooling.ClonePart = Nothing
clonePart54 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\m_gba_1.prt")

Dim clonePart55 As NXOpen.Tooling.ClonePart = Nothing
clonePart55 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\m_gba_1.prt")

Dim clonePart56 As NXOpen.Tooling.ClonePart = Nothing
clonePart56 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\m_gba_1.prt")

Dim clonePart57 As NXOpen.Tooling.ClonePart = Nothing
clonePart57 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\m_gba.prt")

Dim clonePart58 As NXOpen.Tooling.ClonePart = Nothing
clonePart58 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\m_gba.prt")

Dim clonePart59 As NXOpen.Tooling.ClonePart = Nothing
clonePart59 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\m_gba.prt")

Dim clonePart60 As NXOpen.Tooling.ClonePart = Nothing
clonePart60 = cloneObject1.FindClonePartItem("C:\Program Files\Siemens\NX 12.0\moldwizard\moldbase\metric\futaba\fm_de\m_gba.prt")

' ----------------------------------------------
' Dialog Begin Part Name Management
' ----------------------------------------------
Dim markId5 As NXOpen.Session.UndoMarkId = Nothing
markId5 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Invisible, "Part Name Management")

theSession.DeleteUndoMark(markId5, Nothing)

Dim markId6 As NXOpen.Session.UndoMarkId = Nothing
markId6 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Invisible, "Part Name Management")

theSession.DeleteUndoMark(markId6, Nothing)

theSession.SetUndoMarkName(markId4, "Part Name Management")

theSession.DeleteUndoMark(markId4, Nothing)

Dim clonedpartname1 As String = Nothing
clonedpartname1 = cloneObject1.Commit()

cloneObject1.SyncPartNumber()

cloneObject1.Dispose()
addReusablePart1.Destroy()

Dim part1 As NXOpen.Part = CType(theSession.Parts.FindObject("proj_fd_656"), NXOpen.Part)

Dim basePoint1 As NXOpen.Point3d = New NXOpen.Point3d(0.0, 0.0, 0.0)
Dim orientation1 As NXOpen.Matrix3x3 = Nothing
orientation1.Xx = 1.0
orientation1.Xy = 0.0
orientation1.Xz = 0.0
orientation1.Yx = 0.0
orientation1.Yy = 1.0
orientation1.Yz = 0.0
orientation1.Zx = 0.0
orientation1.Zy = 0.0
orientation1.Zz = 1.0
Dim partLoadStatus1 As NXOpen.PartLoadStatus = Nothing
Dim component1 As NXOpen.Assemblies.Component = Nothing
component1 = workPart.ComponentAssembly.AddComponent(part1, Nothing, "MOLD BASE", basePoint1, orientation1, -1, partLoadStatus1)

partLoadStatus1.Dispose()
theSession.DeleteUndoMark(markId3, Nothing)

workPart = theSession.Parts.Work ' TestFillSurface
theSession.SetUndoMarkName(markId1, "Mold Base Library")

standardPartBuilder1.Destroy()

spreadsheetData1.Dispose()
' ----------------------------------------------
' Menu: Tools->Journal->Stop Recording
' ----------------------------------------------

End Sub
End Module
>

Kien

I'd suggest using a Try block to test for the error and take action accordingly. Some pseudocode below:

Dim part1 As NXOpen.Part = Nothing
Try
part1 = CType(theSession.Parts.FindObject("proj_fd_656"), NXOpen.Part)
Catch ex as nxerror
if ex = object not found then
part1 = code to open part
end if
Finally
if part1 = nothing then
'warn user, throw error, etc
end if
End Try

Thanks you so much.
I will try it. Currently I also work on EDM Design and I find gadgets following this youtube link. Do you have codes related to these utilities?
Link:
https://www.youtube.com/watch?v=ShXSmVDyQyE&list=PLvMwfUBcGJWVHuWTnynJUI...

Kien