我想在创建活动时使用ctb,并使用Design Automation API将DWG文件转换为PDF。
在PlotToPDF活动中,脚本如下
"Instruction": {
"CommandLineParameters": "-suppressGraphics",
"Script": "_layoutcreateviewport 1 _tilemode 0 -export _pdf _all result.pdf\n"
}
如果要应用CTB文件并将其转换为PDF,则脚本是如何编写的?
Autodesk Design Automation API define Plot Settings e.g. greyscale/linewidth
我尝试了这里写的脚本但是出错了。
[04/19/2019 00:40:15] Command: -PLOT Detailed plot configuration? [Yes/No] <No>: Y
[04/19/2019 00:40:15] Enter a layout name or [?] <レイアウト1>: Enter an output device name or [?] <なし>: AutoCAD PDF (General Documentation).pc3 Y myCTB.ctb
[04/19/2019 00:40:15] <AutoCAD PDF (General Documentation).pc3 Y myCTB.ctb > not found.
[04/19/2019 00:41:15] Error: AutoCAD Core Console is shut down due to timeout.
[04/19/2019 00:41:15] End script phase. [04/19/2019 00:41:15] Error: An unexpected error happened during phase CoreEngineExecution of job.
我按如下方式调整了命令。
-PLOT Y AutoCAD PDF (General Documentation).pc3\n\n\n Y\n\n\n\nY myCTB.ctb\n
结果是错误。
[04/19/2019 01:09:45] Command: -PLOT Detailed plot configuration? [Yes/No] <No>: Y
[04/19/2019 01:09:45] Enter a layout name or [?] <レイアウト1>: Enter an output device name or [?] <なし>: AutoCAD PDF (General Documentation).pc3
[04/19/2019 01:09:45] Enter paper size or [?] <ANSI A (11.00 x 8.50 Inches)>:
[04/19/2019 01:09:45] Enter paper units [Inches/Millimeters] <Millimeters>:
[04/19/2019 01:09:45] Enter drawing orientation [Portrait/Landscape] <Portrait>: Plot upside down? [Yes/No] <No>: Y
[04/19/2019 01:09:45] Enter plot area [Display/Extents/Layout/View/Window] <Layout>:
[04/19/2019 01:09:45] Enter plot scale (Plotted Millimeters=Drawing Units) or [Fit] <1:1>:
[04/19/2019 01:09:45] Enter plot offset (x,y) <0.00,0.00>:
[04/19/2019 01:09:45] Plot with plot styles? [Yes/No] <No>: Y Enter plot style table name or [?] (enter . for none) <>: myCTB.ctb
[04/19/2019 01:10:46] Error: AutoCAD Core Console is shut down due to timeout. [04/19/2019 01:10:47] End script phase.
[04/19/2019 01:10:47] Error: An unexpected error happened during phase CoreEngineExecution of job.
假设您的绘图已经为特定客户CTB文件分配了“绘图样式表”。要使CTB覆盖生效,您只需将CTB文件与绘图文件一起带到Forge DA服务即可。您可以通过以下方式执行此操作:1。创建一个包含图形文件和CTB文件(或您希望的任何其他支持文件,如字体文件)的eTransmit软件包; 2.指定eTransmit zip文件的URL而不是主机图形文件作为输入参数; 3.您仍然可以使用“AutoCAD.PlotToPDF”活动,然后您的CTB绘图样式应该可以使用。
您还可以将CTB下载作为主机绘图输入参数的参考。您的工作项目将如下所示:
{
"activityId": "AutoCAD.PlotToPDF+prod",
"arguments": {
"HostDwg": {
"url": "<download url to host drawing>",
"headers": null,
"references": [
{
"localName": "myCTB.ctb",
"references": null,
"verb": "get",
"url": "<download url to ctb>"
}
],
"verb": "get"
},
"Result": {
"headers": null,
"url": "<upload url for result.pdf>",
"verb": "put"
}
}
}
以下是v2的示例:
{
"ActivityId": "PlotToPDF",
"Arguments": {
"InputArguments": [
{
"Resource": "{\"UserId\":null,\"Version\":0,\"Resource\":\"http://mystore.mycom.com/download/mydwg.dwg\",\"LocalFileName\":\"myDwg.dwg\",\"RelatedFiles\":[{\"UserId\":null,\"Version\":0,\"Resource\":\"http://mystore.mycom.com/download/myCTB.ctb\",\"LocalFileName\":\"myCTB.ctb\",\"RelatedFiles\":[]}]}",
"Name": "HostDwg",
"ResourceKind": "RemoteFileResource"
}
],
"OutputArguments": [
{
"Name": "Result",
"Resource": "http://mystore.mycom.com/path/item/abcd",
"HttpVerb": "POST"
}
]
}
}