Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations 3DDave on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Journal to open a specific part and start edit reusable component in NX11

Status
Not open for further replies.

PSI-CAD

Computer
Feb 13, 2009
997
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

Regards
Didier Psaltopoulos
 
Replies continue below

Recommended for you

Hi,

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
 
Hi,
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor