登录Revit Design Automation加载项 [英] Logging in Revit Design Automation add-in

查看:107
本文介绍了登录Revit Design Automation加载项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将一些诊断输出发送到默认的report.txt文件.

I want to send some diagnostic output to the default report.txt file.

在某些帖子中显示,异常以某种方式(自动或不自动)记录到此report.txt文件中.

In some posts it is shown that exceptions are logged to this report.txt file somehow (automatically or not?).

此外,我在一些示例中看到人们使用日志记录 System.Console.WriteLine()

Also, I see in some samples that people do the logging with System.Console.WriteLine(),

我已经尝试过了,但是仍然无法在报告文件中看到它.

I've tried this, but still can't see it in the report file.

您能告诉我,如何实现这一目标吗? 我知道可以创建另一个日志文件并将其发送回结果,但我认为使用此现有的report.txt会更容易.

Could you tell me, how to achieve this? I understand there is an option to create another log file and send it back with the result, but I think it would be easier to use this existing report.txt.

谢谢!

更新:System.Console.WriteLine()有效.
我没有看到输出的原因是我的加载项无法加载. 因此,它根本没有达到这一行代码.

UPDATE: System.Console.WriteLine() works.
The reason why I didn't see the output was that my add-in failed to load. So, it simply didn't reach this line of code.

推荐答案

使用SystemConsole.WriteLine确实可以登录Revit appbundles的Design Automation.发送到标准输出的所有内容都将捕获在您的workitems report.txt中.例如.

Logging in Design Automation for Revit appbundles can indeed be done with SystemConsole.WriteLine. Anything sent to standard output will be capture in your workitems report.txt. For example.

以下代码:

System.Console.WriteLine("Hello World!");

将在report.txt中生成以下行:

[04/23/2020 19:20:59] Hello World!

这篇关于登录Revit Design Automation加载项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆