Quantcast
Channel: NX Journaling - Journaling / NXOpen API
Viewing all articles
Browse latest Browse all 783

Edit Information MoldBase in Create MoldBase

$
0
0

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>


Viewing all articles
Browse latest Browse all 783

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>