Intellicad Command

Topics relating to AutoLisp and SDS.

Moderators: CMS Inc, avaernes

Post Reply
giskumar
Contributor
Posts: 10
Joined: Fri Nov 26, 2010 5:00 am

Intellicad Command

Post by giskumar » Thu Jan 27, 2011 2:55 am

Hi all

I have written a program in C#.net for intellicad as follows.

Code: Select all

using System;
using System.Collections.Generic;
//using System.Linq;
using System.Text;
using IntelliCAD;
using System.Runtime.InteropServices;
using System.Runtime;

namespace ApplicationAddIn
{
    class Class1
    {
       public static void mycmd()
        {
            IntelliCAD.Application application = (IntelliCAD.Application)Marshal.GetActiveObject("Icad.Application");
            IIcadDocument doc = application.ActiveDocument;
            IIcadModelSpace modl = doc.ModelSpace;
            IntelliCAD.IIcadLibrary lbr = application.Library;
            IIcadPoint pnt1 = lbr.CreatePoint(0, 0, 0);
            IIcadPoint pnt2 = lbr.CreatePoint(50, 50, 0);
            IIcadLine ln = modl.AddLine(pnt1, pnt2);
            ln.Update();
            Marshal.ReleaseComObject(application);
        }
    }
}

I am able to compile and load it successfully.
But i am unclear how can i use this as command in intellicad.

Please Help me.

Thanks,
Kumar.
JCAMPOS

Post by JCAMPOS » Fri Jan 28, 2011 5:53 am

Hi,

You can use it through VBA macros. Create a VBA macro where you load your dll (you can late or early bind it) and then call that VBA macro from Tools->Visual Basic->Macros..., or from a LISP routine.

Regards,
JCAMPOS
Post Reply