// 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;
}
<?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> |
/// <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() |
//----------------------------------------------------------------------------- | |
//----- acrxEntryPoint.cpp | |
//----------------------------------------------------------------------------- | |
#include "StdAfx.h" | |
#include "resource.h" | |
//----------------------------------------------------------------------------- | |
#define szRDS _RXST("MAD") | |
using namespace System; |
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; |
Forge Design Automation for AutoCAD Engine accepts two kinds of modules
- CRX, console runtime extension which is a C++ native application using AutoCAD Core ObjectARX API
- NET, a net assembly which is a managed application using AutoCAD Core .NET API.
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.
- 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",
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
{
{ | |
"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", |