• Suppress output from tcom object

    From Robert Lipman@21:1/5 to All on Tue Aug 29 19:45:49 2023
    I use tcom to create an object in Tcl 8.5.

    set objIFCsvr [::tcom::ref createobject IFCsvr.R300]

    IFCsvr.R300 creates some text output when it starts that I cannot suppress. I've tried many things that do not work. Any suggestions to suppress it or redirect it to a variable that I can work with?

    Thanks,

    Bob Lipman

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andreas Leitgeb@21:1/5 to Robert Lipman on Wed Aug 30 07:12:29 2023
    Robert Lipman <robert.lipman@gmail.com> wrote:
    I use tcom to create an object in Tcl 8.5.
    set objIFCsvr [::tcom::ref createobject IFCsvr.R300]
    IFCsvr.R300 creates some text output when it starts that
    I cannot suppress. I've tried many things that do not work.
    Any suggestions to suppress it or redirect it to a variable
    that I can work with?

    I'd guess that this call causes something to be written to stdout
    or stderr.

    - first, try to examine the documentation of IFCsvr.R300 to see, if
    either that output can be just inhibited, or (on the opposite)
    that you're even legally required to present this to he user.

    - would it be an option to redirect stdout and stderr completely?
    (only viable, if your program itself doesn't itself communicate
    over stdout/-err, and you'd not be violating any licence terms)

    - get extension "Tclx" and look for a recent thread here in this
    group about Tclx and redirecting some component's stdout to a
    file using Tclx's "dup" command.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Harald Oehlmann@21:1/5 to All on Wed Aug 30 11:53:54 2023
    Am 30.08.2023 um 04:45 schrieb Robert Lipman:
    I use tcom to create an object in Tcl 8.5.

    set objIFCsvr [::tcom::ref createobject IFCsvr.R300]

    IFCsvr.R300 creates some text output when it starts that I cannot suppress. I've tried many things that do not work. Any suggestions to suppress it or redirect it to a variable that I can work with?

    Thanks,

    Bob Lipman

    Bob,
    where is the text output ? Does it go to stdout ? Or is it a text box
    shown by the IFC-Application?
    Or do you mean, that something like "tcom::objABC" is printed to the
    console?

    As a side note: TCOM is great stuff but unfortunately unmaintained and
    does not run on 64 bit. TWAPI also has a COM solution. Not so powerful (specially on to implement a com server) but sufficient for most cases.

    Take care,
    Harald

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Robert Lipman@21:1/5 to All on Wed Aug 30 17:57:22 2023
    Hi,

    Here's some more background about the problem. There are two versions of my software, a GUI and a command-line version. You can download them from https://www.nist.gov/services-resources/software/step-file-analyzer-and-viewer and the source code is on
    GitHub https://github.com/usnistgov/SFA

    The IFCsvr generates some text output when the COM object is created and then when the COM object is used. In the GUI version I have no idea where that text output goes. However, in the command-line, both sets of text are created. I'm not interested
    in the first text when the COM object is created, but the other is useful.

    So, in the command-line version I want to suppress the first bit of text, but keep the second set of text which is already the behavior. In the GUI version, I'd also like to get the second set of text, but it's not as important. The suppression is more
    important in the command-line version.

    In general, what would be the common ways to redirect output from: set objIFCsvr [::tcom::ref createobject IFCsvr.R300]

    I have considered twapi which would also let me to upgrade to Tcl 8.6 but it doesn't really buy me anything. Years ago I started making a twapi version but never finished. I never liked the twapi syntax for iterating on a COM object. Tcom has ::tcom::
    foreach which looks a lot better.

    Thanks,

    Bob

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)