0

I am searching for an option to define the Plot Settings when converting a .dwg file to a .pdf file. I want to have the converted PDF in greyscale and the linewidth of the Elements is too big. How can I define the Plotsettings in my API call to Forge Design-Automation-API?

Thankyou

Kaliph
  • 81
  • 10

2 Answers2

2

You will need to create a custom activity to do this. If you know how to do this using the -PLOT command on the AutoCAD command line then this will be relatively easy exercise. Here's a tutorial that shows how to create a custom activity: https://github.com/szilvaa/acadio-tutorials/blob/master/tutorial2/readme.md.

If you need help with some details then post here.

Albert Szilvasy
  • 461
  • 3
  • 5
  • Do I have to define the -PLOT Option here? "Instruction": { "Script": "-PLOT" }, I can convert DWG to PDF but the line weight is to big. I want to become all lines thinner. Could be also a font weight setting. I am not so sure about this yet. – Kaliph Jun 04 '18 at 21:18
  • Yes, you would do it in the "Script" attribute. – Albert Szilvasy Jun 05 '18 at 01:23
  • Can u share the script to plott everything into greyscale. At the moment I have no clue how to define this. – Kaliph Jun 05 '18 at 09:32
1

@Kaliph,

regarding with plotting drawing to greyscale, as said, AutoCAD Design Automation (DA) is a kind of headless AutoCAD on the cloud. you could firstly check how local AutoCAD works with the script, then move to DA. e.g. checking '-plot' command in AutoCAD help, you would find the script would export the drawing to greyscale pdf by a plotstyle:

 -PLOT Y  AutoCAD PDF (General Documentation).pc3       Y Grayscale.ctb    \n

please note the spaces, which mean inputting default values. Grayscale.ctb is a default style of gray scale. I'd suggest you play it with local AutoCAD firstly to ensure the inputting.

If you need more flexible configuration on run-time of DA, you would need to produce your own plugin of AutoCAD by C#, VB.NET, C++, LISP. Most requirements have to be implemented by custom commands, instead of by built-in scripts only.

Xiaodong Liang
  • 2,051
  • 2
  • 9
  • 14
  • Is this API command then like this? "Instruction": { "Script": "-PLOT Y AutoCAD PDF (General Documentation).pc3 Y Grayscale.ctb \n" }, If I am using this in my conversion command, I get the following message "The property 'Instruction' does not exist on type 'ACES.Models.WorkItem'. Make sure to only use property names that are defined by the type." – Kaliph Jun 07 '18 at 14:16
  • Am I able to include this command into my workitem? Or do I have to create a new API Command to send against /Activities after the workitem is placed? – Kaliph Jun 07 '18 at 14:24
  • @Kaliph, yes, like that, but I do not encounter such issue before. please post the complete test for diagnose. you could also email to forge.help@autodesk.com if some info is private. – Xiaodong Liang Jun 11 '18 at 02:58