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 / ImgSamp.vcxproj
Created January 22, 2025 15:22
AutoCAD Custom Raster Image Handling : Embedding and Display Techniques
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{21E65A9C-E654-4DDA-B631-4CA512141022}</ProjectGuid>
@MadhukarMoogala
MadhukarMoogala / UpdateAssociatePlanarSurface.cs
Created November 25, 2024 16:26
Updates the profile curve of an associative planar surface in AutoCAD.
/// <summary>
/// Updates the profile curve of an associative planar surface in AutoCAD.
/// Assumes the user has selected a planar surface with a rectangular profile curve.
/// Demonstrates the workflow for:
/// - Verifying surface associativity
/// - Extracting and transforming the profile
/// - Updating the surface with a modified profile
/// </summary>
[CommandMethod("UpdateAssociatePlanarSurface")]
public static void UpdateAssociatePlanarSurface()
@MadhukarMoogala
MadhukarMoogala / AutoCADPlugin.cpp
Last active November 16, 2024 14:09
Building a Sample AutoCAD Plugin using C++/CLI for AutoCAD 2025 and later version using .NET 8.0
//-----------------------------------------------------------------------------
//----- acrxEntryPoint.cpp
//-----------------------------------------------------------------------------
#include "StdAfx.h"
#include "resource.h"
//-----------------------------------------------------------------------------
#define szRDS _RXST("MAD")
using namespace System;
@MadhukarMoogala
MadhukarMoogala / source.md
Created October 22, 2024 13:12
Working with UCS and Ordinate Dimensions in AutoCAD using .NET API
    // Tolerance for detecting near-zero values,
    // used to account for floating-point precision errors.
    const double ANGLE_EPSILON = 1E-15;

    // Checks if a given number is near zero, within a defined tolerance.
    public static bool IsNearZero(double num)
    {
        return num < ANGLE_EPSILON && num > -ANGLE_EPSILON;
    }
@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",