onodip
Aerospace
- Oct 9, 2019
- 4
In the journal manager of NX it is possible enter arguments, which in principle can be passed to the journal.
In a Python journal typically a [tt]main[/tt] function is called. Since the function call is part of the script, I am not sure how NX can pass anything to it. Is there any special variable for the journal manager arguments that can be imported, or can it be somehow accessed from a Session or UFSession object?
I included a simple example, where I would like a message box to pop up with the arguments from the Journal Manager (see the attached picture).
In a Python journal typically a [tt]main[/tt] function is called. Since the function call is part of the script, I am not sure how NX can pass anything to it. Is there any special variable for the journal manager arguments that can be imported, or can it be somehow accessed from a Session or UFSession object?
I included a simple example, where I would like a message box to pop up with the arguments from the Journal Manager (see the attached picture).
Python:
import NXOpen
import NXOpen.UF
def main(arg):
"""Takes a string argument, and shows it in a message box."""
uf_session = NXOpen.UF.UFSession.GetUFSession()
message = "The following arguments were passed to my journal:" + arg
uf_session.Ui.DisplayMessage(message, 1)
if __name__ == '__main__':
main() # Somehow the arguments of the journal manager should be passed