I’m trying to develop an automation using IntelliCAD and .NET. However, even a simple “Hello World” example isn’t working as expected. My DLL loads successfully, but I can’t invoke the method. It seems like I’m missing something minimal.
I tested the same code in AutoCAD, and it works fine. When I try to compile the files using the IntelliCAD SDK, I get the following error: "Can’t get Entry Point function in DLL; Load failed c:\users"
Can anyone help me understand what might be going wrong? I’m using VS Code for development. Below are the .csproj and .cs files.
Do I need to set any specific configuration to use methods via .NET in IntelliCAD after using NETLOAD? Even the ExDraw code doesn’t run on my machine.
Thank you in advance for your help!
Code: Select all
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Library</OutputType>
<RootNamespace>Lab1</RootNamespace>
<AssemblyName>Lab1</AssemblyName>
<TargetFramework>net46</TargetFramework>
<UseSdk>Microsoft.NET.Sdk</UseSdk>
</PropertyGroup>
<ItemGroup>
<Reference Include="IcMgd_4.01_11">
<HintPath>libs/IcMgd_4.01_11.dll</HintPath>
</Reference>
<Reference Include="TD_Mgd_4.01_11">
<HintPath>libs/TD_Mgd_4.01_11.dll</HintPath>
</Reference>
<Reference Include="IcCoreMgd_4.01_11">
<HintPath>libs/IcCoreMgd_4.01_11.dll</HintPath>
</Reference>
<Reference Include="Teigha.DatabaseServices">
<HintPath>libs/TD_Mgd_4.01_11.dll</HintPath>
</Reference>
<Reference Include="Teigha.Runtime">
<HintPath>libs/TD_Mgd_4.01_11.dll</HintPath>
</Reference>
<Reference Include="IntelliCAD.ApplicationServices">
<HintPath>libs/IcCoreMgd_4.01_11.dll</HintPath>
</Reference>
<Reference Include="IntelliCAD.EditorInput">
<HintPath>libs/IcCoreMgd_4.01_11.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Reference Include="Accessibility" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="PresentationUI" />
<Reference Include="ReachFramework" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Printing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xaml" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="UIAutomationProvider" />
<Reference Include="UIAutomationTypes" />
<Reference Include="WindowsBase" />
<Reference Include="WindowsFormsIntegration" />
</ItemGroup>
</Project>
Code: Select all
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Teigha.Runtime;
using IntelliCAD.EditorInput;
using IntelliCAD.ApplicationServices;
using Teigha.Geometry;
using Teigha.DatabaseServices;
namespace Lab1
{
public class classe1
{
[CommandMethod("HelloWorld")]
public void test1()
{
Document objDoc = Application.DocumentManager.MdiActiveDocument;
Editor objEd = objDoc.Editor;
objEd.WriteMessage("\nBlock");
}
}
}