Journal to open a specific part and start edit reusable component in NX11
Journal to open a specific part and start edit reusable component in NX11
(OP)
Hi,
I am looking for a sample Journal to open a specific part and start edit reusable component in NX11.
I was able to record the journal and change the line to enter the specified part like c:/temp/template_pts.prt but the start function "edit reusable component" is not well recorder an it doesn't work
Thank in advance
I am looking for a sample Journal to open a specific part and start edit reusable component in NX11.
I was able to record the journal and change the line to enter the specified part like c:/temp/template_pts.prt but the start function "edit reusable component" is not well recorder an it doesn't work
Thank in advance
Regards
Didier Psaltopoulos
http://www.psi-cad.fr





RE: Journal to open a specific part and start edit reusable component in NX11
Here is my recorded code: thanks in advance for your help
' NX 11.0.1.11
' Journal created by Didier Psaltopoulos on Tue Mar 07 23:19:32 2017 Paris, Madrid
'
Imports System
Imports NXOpen
Module NXJournal
Sub Main (ByVal args() As String)
Dim theSession As NXOpen.Session = NXOpen.Session.GetSession()
' ----------------------------------------------
' Menu: Fichier->Ouvrir...
' ----------------------------------------------
Dim part1 As NXOpen.Part = Nothing
part1 = theSession.Parts.Display
Dim fullPath1 As String = Nothing
fullPath1 = part1.FullPath
Dim historyList1() As NXOpen.BasePart.HistoryEventInformation
historyList1 = part1.GetHistoryInformation()
Dim basePart1 As NXOpen.BasePart = Nothing
Dim partLoadStatus1 As NXOpen.PartLoadStatus = Nothing
basePart1 = theSession.Parts.OpenBaseDisplay("c:\temp\template_PTS.prt", partLoadStatus1)
Dim workPart As NXOpen.Part = theSession.Parts.Work
Dim displayPart As NXOpen.Part = theSession.Parts.Display
partLoadStatus1.Dispose()
Dim markId1 As NXOpen.Session.UndoMarkId = Nothing
markId1 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Visible, "Enter Gateway")
theSession.ApplicationSwitchImmediate("UG_APP_GATEWAY")
theSession.ApplicationSwitchImmediate("UG_APP_MODELING")
Dim markId2 As NXOpen.Session.UndoMarkId = Nothing
markId2 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Visible, "Enter Modeling")
' ----------------------------------------------
' Menu: Outils->Bibliothèque de réutilisation->Editer un composant réutilisable...
' ----------------------------------------------
Dim markId3 As NXOpen.Session.UndoMarkId = Nothing
markId3 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Visible, "Départ")
workPart.RuleManager.CreateDynamicRule("root:", "CinematiqueGRZO", "Child", "{class, CinematiqueGRZO;}", Nothing)
theSession.SetUndoMarkName(markId3, "Boîte de dialogue Création d'un moule de bouchon")
' ----------------------------------------------
' Menu: Outils->Journal->Arrêter l'enregistrement
' ----------------------------------------------
End Sub
End Module
Regards
Didier Psaltopoulos
http://www.psi-cad.fr
RE: Journal to open a specific part and start edit reusable component in NX11
I discovered that it is not possible to start Edit Reusable Component with NXOPEN.
So,I used a simple macro to do the job, but I am not very happy because it'is not a reliable solution for the future.
Regards
Didier Psaltopoulos
http://www.psi-cad.fr