A CLI utility based on .NET Core technology to print multiple drawings in to a single pdf, the application logic in Bundle uses
PublishExecute API
Uses Forge Design Automation V3
- Forge Account: Learn how to create a Forge Account, activate subscription and create an app at this tutorial.
- Visual Code: Visual Code (Windows or MacOS)
- .netcore 3.1: dotnet core SDK
- 7z 7z Zip Archive
- Make sure
7z.exe
is available on your system path env.
git clone https://github.com/MadhukarMoogala/FDA_PublishDSD
cd BatchPublishCommand
msbuild BatchPublishCommand.csproj -property:Configuration=Debug;Platform=x64
cd BatchPublishCommand\client
notepad appsettings.users.json `feed with your Forge Credentials`
dotnet build
dotnet run -c RELEASE -i "<inputZipFileWithDrawings>" -o "<outputFolder>"
appsettings.users.json
{
"Forge": {
"ClientId": "ForgeClientId",
"ClientSecret": "ForgeClientSecret"
}
}
launchsettings.json
{
"profiles": {
"ClientV3": {
"commandName": "Project",
"commandLineArgs": "-i \"C:\\Users\\moogalm\\Downloads\\exported.zip\" -o D:\\Work\\Arxprojects\\2020\\BatchPublishCommand\\output",
"workingDirectory": "..\\bin\\Release\\netcoreapp3.1",
"environmentVariables": {
"FORGE_CLIENT_SECRET": "ForgeClientId",
"FORGE_CLIENT_ID": "ForgeClientSecret"
}
}
}
}
edit launchsettings.json
launch ClientV3 profile.
edit .csproj.user
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<StartArguments>/s test.scr</StartArguments>
<StartAction>Program</StartAction>
<StartProgram>C:\Program Files\Autodesk\AutoCAD 2020\accoreconsole.exe</StartProgram>
</PropertyGroup>
</Project>
If the layout does not have an initialized page setup in drawings, this app will not be able to process, an error no plottable sheets found
is thrown, the reason could be the drawings are from older versions of AutoCAD or from third-party applications.
Open the file in AutoCAD and execute the PAGESETUP command on each layout to define it, which may simply entail modifying and then clicking OK, assuming the printer and other settings are correct.
As an alternative, within the Publish window, click the Page Setup pop-up menu on one of the layouts and choose Import. If a named page setup has been defined in another file, and is usable for the desired publish, it can be imported and applied to all the layouts in the sheet list.
This sample is licensed under the terms of the MIT License. Please see the LICENSE file for full details.
Madhukar Moogala, Forge Partner Development @galakar