Skip to content

MadhukarMoogala/FDA_PublishDSD

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Design Automation for AutoCAD Application

Data-Management Design-Automation netCore

Description

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

Design Automation

WorkInDA

Prerequisites

  1. Forge Account: Learn how to create a Forge Account, activate subscription and create an app at this tutorial.
  2. Visual Code: Visual Code (Windows or MacOS)
  3. .netcore 3.1: dotnet core SDK
  4. 7z 7z Zip Archive
  5. Make sure 7z.exe is available on your system path env.

git clone https://github.com/MadhukarMoogala/FDA_PublishDSD

Instructions To Build AutoCAD Addin

cd BatchPublishCommand
msbuild BatchPublishCommand.csproj -property:Configuration=Debug;Platform=x64

Instructions To Build and Test Forge DA Client

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"
      }
    }
  }
}

Instructions To Debug

.NETCore
edit launchsettings.json
launch ClientV3 profile.

AutoCAD Addin

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>

Known Limitation

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.

How to Fix:

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.

License

This sample is licensed under the terms of the MIT License. Please see the LICENSE file for full details.

Written by

Madhukar Moogala, Forge Partner Development @galakar

About

A CLI utility batch publish multiple drawings to single PDF using Forge Design Automation for AutoCAD

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages