SDS .NET API

Topics relating to AutoLisp and SDS.

Moderators: CMS Inc, avaernes

Post Reply
Danielm103
Valued Contributor
Posts: 54
Joined: Mon Aug 07, 2006 11:01 pm
Location: Albuquerque,NM,USA

SDS .NET API

Post by Danielm103 » Sat Jul 21, 2007 11:03 am

Would anyone here be interested in using/beta testing a .NET API out? It’s still in its infancy, if there is enough interest I will keep hacking at it , else -> bit bucket.

Dan
Danielm103
Valued Contributor
Posts: 54
Joined: Mon Aug 07, 2006 11:01 pm
Location: Albuquerque,NM,USA

Post by Danielm103 » Sun Oct 07, 2007 1:23 pm

Well what do you know it worked, my .NET wrappers for SDS also seem to work with Intellicad’s new 6.4 object model, I was able to draw a line using this code. Kewl!

C# !!

Code: Select all

//intellicad com
    [CommandMethod("Test")]
    public static void Test1()
    {
      try
      {
        IntelliCAD.Application application = 
          (IntelliCAD.Application)Marshal.GetActiveObject("Icad.Application");
        IntelliCAD.Document document = application.ActiveDocument;
        IntelliCAD.ModelSpace modelspace = document.ModelSpace;
        IntelliCAD.Library library = application.Library;
        IntelliCAD.Point point1 = library.CreatePoint(0,0,0);
        IntelliCAD.Point point2 = library.CreatePoint(100,100,0);
        IntelliCAD.Line line = modelspace.AddLine(point1, point2);
        line.Update();
        Marshal.ReleaseComObject(application);
      }
      catch (SystemException e)
      {
        DWM.Cad.RuntimeServices.Utilities.WriteMessage(e.Message);
      }
    }

    //through the lisp engine
    [CommandMethod("TestLine1")]
    public static void Testline1()
    {
      using (Line myLine = new Line())
      {
        myLine.Layer = "0";
        myLine.StartPoint = new Point3D(0, 0, 0);
        myLine.EndPoint = new Point3D(100, 100, 0);
        myLine.Update();
      }
    }
[/code]
benqsmith
Newbie
Posts: 7
Joined: Sun Mar 26, 2006 11:01 pm

.Net SDS Api

Post by benqsmith » Mon Oct 08, 2007 8:17 am

Danielm103,

I'd be very interested in trying out your sds api. I've been using vb6, .net & COM interop to build addins, and I'd love to be able to access some of the extra functionality in the icad api (and finally ditch vb6 and COM!).

thanks!
benqsmith (at) yahoo (dot) com
Danielm103
Valued Contributor
Posts: 54
Joined: Mon Aug 07, 2006 11:01 pm
Location: Albuquerque,NM,USA

Post by Danielm103 » Tue Oct 23, 2007 9:01 am

I haven’t forgotten about you. I ran into issues with forms not working correctly with certain functions, such as GetPoint(). Once I get this solved I will let you all know. I am also considering making this an open source project and posting the source on one of the open source sites.
Dan
giskumar
Contributor
Posts: 10
Joined: Fri Nov 26, 2010 5:00 am

Post by giskumar » Tue Nov 30, 2010 4:03 am

Hi Danielm,

I am new to Intellicad.
When i tried to use the C# code in my dotnet 2005 ide, at CommandMethod i am getting error.

Code: Select all

using System;
using System.Collections.Generic;
using System.Text;
using IntelliCAD;



namespace ClassLibrary1
{
    public class Class1
    {
        [LispFunction("Test")]
        public static void Test1()
        {
            try
            {
                IntelliCAD.Application application =
                (IntelliCAD.Application)Marshal.GetActiveObject("Icad.Application");
                IntelliCAD.Document document = application.ActiveDocument;
Please suggess me which reference i need to add to resolve this problem.

Thanks,
Kumar.
giskumar
Contributor
Posts: 10
Joined: Fri Nov 26, 2010 5:00 am

Post by giskumar » Tue Nov 30, 2010 4:32 am

Hi,

After some research, i found the command method [Lispfunction] will comes with acdmg.dll. If we dont have installed Autocad 2010 product, can't use [LispFunftion].

Is there any related command method is there in Intellicad namespace.


Thanks in advance,
Kumar.
Danielm103
Valued Contributor
Posts: 54
Joined: Mon Aug 07, 2006 11:01 pm
Location: Albuquerque,NM,USA

Post by Danielm103 » Sat Jan 08, 2011 9:17 am

Sorry, I wrote that module quite a long time ago, I haven't been keeping it up to date as there didn;t seem to be much interest. About the only thing I am maintaining in SDS is SQLite for autolisp.
cheers
MROCK
Valued Contributor
Posts: 45
Joined: Mon Oct 09, 2000 11:01 pm
Location: Rio de Janeiro, RJ, Brazil
Contact:

Post by MROCK » Fri Mar 09, 2012 1:01 pm

Now we have Icad7, many things are changing with the APIs. We are trying to write applications in C#.
How can I make the call of C# functions from the command line?

CommandMethod is not accepted when using the Intellicad Object library.

Are there other dlls necessary?
Any idea where I could get some more information?
JCAMPOS

Post by JCAMPOS » Mon Mar 12, 2012 5:52 am

MROCK,

Are you talking about SDS? Or other environment?
You can write C# applications through different ways. I suppose it will all depend on your particular needs. The developers reference in the program's help should give you a light of the available options.

Regards,
JCAMPOS
Post Reply