×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

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

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

Regards
Didier Psaltopoulos
http://www.psi-cad.fr

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

(OP)
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
http://www.psi-cad.fr

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

(OP)
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
http://www.psi-cad.fr

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources