简体   繁体   English

Autodesk 设计自动化 Revit,文本文件作为输入

[英]Autodesk design automation Revit , text file as input

The Revit API I developed, take a text file as input.我开发的Revit API,以文本文件为输入。 the text file looks like as below......文本文件如下所示......

1.002, 20,502, 21.706 1.002、20,502、21.706

12.502, 5,502, 7.706 12.502、5,502、7.706

21.002, 15,502, 14.706 21.002、15,502、14.706

..................... .....................

..................... (The values are not correct.just imaginary. I am just showing how my text file looks like) .....................(值不正确。只是虚构的。我只是展示我的文本文件的样子)

I am basically reading the text data as input.我基本上是在读取文本数据作为输入。 Now if I want to convert the same API as Design automation API, I guess I will not be able to use "text file" as input.现在,如果我想将相同的 API 转换为设计自动化 API,我想我将无法使用“文本文件”作为输入。

My question is, what should be file type of input file, if it is consisted of 3d point coordinates as described above.我的问题是,输入文件的文件类型应该是什么,如果它由如上所述的 3d 点坐标组成。 Should it be Json?应该是 Json 吗? If it need to be json, then how I should write it for point coordinates?如果它需要是json,那么我应该如何写它的点坐标? or any other suggestion for file type will be a big help.或任何其他关于文件类型的建议都会有很大帮助。

If there is any example code, will be a big help.如果有任何示例代码,将是一个很大的帮助。

In the list for supported input file format, txt file is not included.在支持的输入文件格式列表中,不包括 txt 文件。

If I write a Json file, then please give me some clue, how should I arrange it and read the file for Revit.如果我写一个 Json 文件,那么请给我一些线索,我应该如何安排它并为 Revit 读取文件。

Many thanks in advance.提前谢谢了。

T

Thank you for your query.感谢您的询问。

The slightly more complex question is how to generate multiple output files.稍微复杂一点的问题是如何生成多个 output 文件。

That is answered by the article on How to generate dynamic number of output with Design Automation for Revit V3 .关于如何使用 Revit V3 的设计自动化生成 output 的动态编号的文章对此进行了回答。

In passing, it also mentions multiple input files, saying:顺便说一句,它还提到了多个输入文件,说:

"... For the zipped input file, it's well documented at https://forge.autodesk.com/en/docs/design-automation/v3/tutorials/revit/step6-post-workitem/ , but for the output zipped result, it's not so clear..." “...对于压缩的输入文件,它在https://forge.autodesk.com/en/docs/design-automation/v3/tutorials/revit/step6-post-workitem/中有详细记录,但对于 output 压缩结果,还不是很清楚……”

Trying to follow that link, I note that it is out of date.尝试访问该链接时,我注意到它已过时。

The updated link is:更新的链接是:

https://forge.autodesk.com/en/docs/design-automation/v3/tutorials/revit/step7-post-workitem/ https://forge.autodesk.com/en/docs/design-automation/v3/tutorials/revit/step7-post-workitem/

Looking at the additional notes on input arguments , I see the instructions on how to pass JSON input data directly in the workitem itself.查看有关输入 arguments 的附加说明,我看到了有关如何在工作项本身中直接传递 JSON 输入数据的说明。

I would assume that you can also use a different prefix instead of data:application/json such as data:application/text to pass in the data in its current form.我假设您也可以使用不同的前缀而不是data:application/json例如data:application/text以当前形式传入数据。

Please try that out and let us know how it works for you.请尝试一下,让我们知道它如何为您工作。

Alternatively, you can just stay on the safe side and convert your text data to JSON format.或者,您可以保持安全,将文本数据转换为 JSON 格式。

There are innumerable ways of doing so.有无数种方法可以做到这一点。

The most minimalistic and simple would look like this:最简约和最简单的看起来像这样:

    [1.002, 20,502, 21.706,
    12.502, 5,502, 7.706,
    21.002, 15,502, 14.706,
    ...]

That represents on single array of doubles.这代表单个双精度数组。

A slightly more structured approach might be to pass in an array of triples of doubles like this:一种稍微结构化的方法可能是传入一个三元组的数组,如下所示:

    [[1.002, 20,502, 21.706],
    [12.502, 5,502, 7.706],
    [21.002, 15,502, 14.706],
    ...]

As you see, it is not hard.如您所见,这并不难。

I hope this helps.我希望这有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用 Design Automation for revit 和 IFC 输入文件 - Use Design Automation for revit with an IFC input file 设计自动化中的 Autodesk.Revit.Exceptions.InvalidOperationException 错误 API - Autodesk.Revit.Exceptions.InvalidOperationException error in Design Automation API 在 Autodesk Revit Forge Design Automation 中创建具有纹理的材质 - Creating a material with texture in Autodesk Revit Forge Design Automation Autodesk Forge设计自动化-Revit IO:无法将应用程序包上传到设计自动化应用程序 - Autodesk Forge Design automation - Revit IO: unable to upload application package to design automation app Revit output 压缩文件的设计自动化为空 - Design Automation for Revit output zipped file is empty Revit的设计自动化api中如何在workitem方法中动态更改输入输出文件的名称 - How to change the name of the input and output file dynamically in workitem method in design automation api for Revit Autodesk Forge 设计自动化 - Autodesk Forge design automation Autodesk Forge +设计自动化 - Autodesk Forge + design automation 上传 Autodesk 设计自动化、dotnet Core…1 rfa 和 1 个大 Json 文件作为输入传递时出错 - Error uploading Autodesk design automation, dotnet Core… 1 rfa and 1 big Json file to pass as input Autodesk设计自动化 - autodesk design automation
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM