Skip to content

Instantly share code, notes, and snippets.

View MadhukarMoogala's full-sized avatar
🎯
Focusing

Madhukar Moogala MadhukarMoogala

🎯
Focusing
View GitHub Profile
@MadhukarMoogala
MadhukarMoogala / Program.cs
Created December 8, 2020 04:46
Yet another DA tiny console application
using Autodesk.Forge.Core;
using Autodesk.Forge.DesignAutomation;
using Kurukuru;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using Serilog;
using System;
using System.Text;
@MadhukarMoogala
MadhukarMoogala / main.md
Last active November 15, 2019 16:50
How to convert your plugin to work with Design Automation for AutoCAD

How to convert your plugin to work with Design Automation for AutoCAD

Forge Design Automation for AutoCAD Engine accepts two kinds of modules

  1. CRX, console runtime extension which is a C++ native application using AutoCAD Core ObjectARX API
  2. NET, a net assembly which is a managed application using AutoCAD Core .NET API.

Section: CRX

We will discuss how to create a crx application step by step, at the end of this tutorial you can also find a video tutorial and complete source code on GitHub.

  1. Please refer crx step by step
using Azure.Storage;
using Azure.Storage.Blobs;
using Azure.Storage.Blobs.Models;
using DotNetEnv;
using System;
using System.IO;
using System.Threading.Tasks;

namespace blobdwgTest

Please use the workitem json as it is, all you need is to edit the url in Outputfile Arguments and Authorization oAuthtoken I understand there is truncation erros when file sent to you. replace {{yourbucket}} with bucket you created replace {{output.dwg}} with object you put.

{
 "activityId": "uLIUN5bLOzQCmoEARUNfG0g1Nr66hj7S.UpdateParameters+dev",
@MadhukarMoogala
MadhukarMoogala / sample.md
Last active June 28, 2019 10:52
Activity_WorkItem_Payload_Json

Activity Payload Json

Here we have added another parameter MaxFileName and modified InputFile such that, upon recieving input zip, it will be unzipped into workingFolder MaxFileName parameter reads the file from unzipped folder this argument sematic explains that \"$(args[InputZip].path)/$(args[MaxFileName].value)\" $(args[myParam1].path) for a given parameter with the key "myParam1", this will be replaced by the file path where the file got uploaded/downloaded to. If the parameter is a zip, it will be replaced by the path to the folder where the zip got unzipped. $(args[myStringParam].value) will be replaced by the string value provided at work item submission of the parameter with the key "myStringParam" (Only for argument using the read verb). Possible values of verb -get, head, put, post, patch, read

{
@MadhukarMoogala
MadhukarMoogala / .vsconfig
Last active May 22, 2019 06:08
For VS2019
{
"version": "1.0",
"components": [
"Microsoft.VisualStudio.Component.CoreEditor",
"Microsoft.VisualStudio.Workload.CoreEditor",
"Microsoft.VisualStudio.Component.NuGet",
"Microsoft.VisualStudio.Component.Roslyn.Compiler",
"Microsoft.VisualStudio.Component.Roslyn.LanguageServices",
"Microsoft.Net.Core.Component.SDK.2.1",
"Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions",

By Madhukar Moogala

I have received following query from an ADN partner recently, which seems to be quiet interesting.

Question:I want to watch _copyclip and _pasteclip to modify some entities after they have been pasted to another drawing. How do I get a map of the original clipboard objects to the new objects that were pasted in a second drawing?

User is interested to know objects that object mapping between source and destination drawings which may help in executing additionally functionalities on items that being copied.

To achieve we need to watch for AcEditorReactor :: otherBlock while performing _copyclip operation and AcEditorReactor:: otherInsert while performing _pasteclip operation.

@MadhukarMoogala
MadhukarMoogala / Build-AutoCADOem.bat
Last active May 2, 2018 10:38
OembuildFromCommandLine
@echo off
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:::
::: Created by Madhukar Moogala
::: Autodesk Devtech
:::
:::
::: This batch program builds an AutoCAD OEM Product, TestCAD. This product is used
::: as the host application for the OEM Build and Diagnositics.
:::
@MadhukarMoogala
MadhukarMoogala / EXPTXT.cs
Last active April 11, 2018 11:36
Explode To Text
public void EXPTXT()
{
var doc = Application.DocumentManager.MdiActiveDocument;
var db = doc.Database;
var ed = doc.Editor;
// selection text
ObjectId[] dbtextIds = ed.SelectTextEntitesInModelSpace();
foreach (ObjectId id in dbtextIds)
{