Submitted by uwe.a on Sun, 07/13/2014 - 10:18
Forums:
Hi,
looking for a way to check all prt files in a directory for example if datum csys exits.
No problem, to do this, but I don't want to run/open all files visable in session.
I just want a report in silent mode, started from an nx session.
please give me an idea.
thanks
re: checking files
If you have an author license and you don't need to interact with the GUI, you can compile your code to run in 'batch' mode - essentially an exe file that runs outside of NX.
If you do not have an author license or prefer to run it as a journal, I'd try suppressing the display while the code runs.
'turn display updating off
theUfSession.Disp.SetDisplay(UFConstants.UF_DISP_SUPPRESS_DISPLAY)
'lots of code
'turn display updating on
theUfSession.Disp.SetDisplay(UFConstants.UF_DISP_UNSUPPRESS_DISPLAY)
'regenerate display
theUfSession.Disp.RegenerateDisplay()
checking
I will give it try,
thanks
suppressing output
Hm, there are situation it is helpful, ok
another use case I can not handle is suppressing the dos box doing a step export:
Dim step214Creator1 As Step214Creator = theSession.DexManager.CreateStep214Creator()
step214Creator1.ObjectTypes.Solids = True
step214Creator1.OutputFile = file
step214Creator1.BsplineTol = 0.001
step214Creator1.FileSaveFlag = False
step214Creator1.LayerMask = "1-256"
'step214Creator1.SetUserCredential("", "", "")
step214Creator1.ExportSelectionBlock.SelectionScope = ObjectSelector.Scope.SelectedObjects
Dim added1 As Boolean = step214Creator1.ExportSelectionBlock.SelectionComp.Add(sbody)
Dim nXObject1 As NXObject
nXObject1 = step214Creator1.Commit()
step214Creator1.Destroy()
???
thanks in advance
treading, supressing the dos box
As I told above I want to suppress the mass of dos boxes opening in a translation job, will
force stop working with other programms on the same machine, every new dos box will have the main window focus.
Is there a way to let the dos bos in a translation process run in background, silent, without a primary focus?
thank you in advance
re: suppressing DOS box
If you start the process yourself, you can suppress the DOS box; see the convert part units journal as an example:
http://nxjournaling.com/content/convert-part-units
However, in this case, the step214Creator object is doing the work behind the scenes and does not give you control over the DOS box. Perhaps if you can work with the external translators directly, you could exert more control. This isn't something that I have tried, so I don't know if it is even feasible; but it may be a way forward.
re: running translator from command line
http://odin.me.memphis.edu/ugs_docs/NX3/dataexchange/howto/how_do.html
Near the bottom of the linked page they give some instructions for running a translator from the command line. Looks like it may be possible...
external translator
the external translator is no choice, because I've collected geometrie in a previous function, to export to step..
thanks in ad
re: external translator
Export the collected geometry out to a temporary part file, then run the translator on the temp file, and finally delete the temp file. A bit more work to set up, but may be worth it if it allows you to suppress the DOS boxes.