Author Topic: NET Party with Bricscad.  (Read 18016 times)

0 Members and 1 Guest are viewing this topic.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8696
  • AKA Daniel
NET Party with Bricscad.
« on: February 26, 2008, 12:53:34 AM »
Off on one of my tangents again, I have stuck all my .NET SDS wrappers into a DRX module that can be loaded into the latest version of Bricscad. Most of it doesn’t work yet. I have not wrapped any of the DRX classes yet. None of the GetXXX() methods work with forms. You can however stick the attached module in your Bricscad support folder and load it via the appload command, and then … you can netload your .NET assemblies. You can add references to the Bricscad COM objects if you want to party on that API. I’ll post the source if someone wants to have a laugh, although you can see it via reflector.

..

latest builds are here

NOTE: this is old stuff please go here http://www.theswamp.org/index.php?topic=29100.0
« Last Edit: January 13, 2010, 07:14:46 AM by Daniel »

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8696
  • AKA Daniel
Re: NET Party with Bricscad.
« Reply #1 on: February 26, 2008, 01:02:06 AM »
Oh yeah, set copy local to false, when you reference this DLL

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8696
  • AKA Daniel
Re: NET Party with Bricscad.
« Reply #2 on: March 05, 2008, 11:48:53 PM »
w00t

Code: [Select]
   [CommandMethodAttribute("AddLayer")]
    public static void test4()
    {
      using (BriApplication BriApp = new BriApplication())
      {
        try
        {
          AcadApplication app = BriApp.Application;
          AcadDocument Doc = app.ActiveDocument;
          AcadDatabase Db = Doc.Database;
          AcadLayers layers = Db.Layers;

          AcadLayer layer = layers.Add("New Layer");
          layer.color = AcColor.acBlue;
          layer.Description = "Cool New Layer";
          layer.Lineweight = ACAD_LWEIGHT.acLnWt009;

          DRXNET.SDS.SDSMethods.Alert
            ("Added layer: " + layer.Name + "\nDescription: " + layer.Description);
        }
        catch (System.Exception ex)
        {
          DRXNET.SDS.SDSMethods.PrintF("\n" + ex.Message);
          DRXNET.SDS.SDSMethods.PrintF("\n" + ex.StackTrace);
        }
      }
    }


MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: NET Party with Bricscad.
« Reply #3 on: March 05, 2008, 11:58:54 PM »
W00t indeed, coming along nicely Daniel. Da swamp is a rockin' tonight with neato experimental stuff; kudos you guys.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8696
  • AKA Daniel
Re: NET Party with Bricscad.
« Reply #4 on: March 06, 2008, 10:02:05 AM »
Thank You, Just having a bit of fun  :-o

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8696
  • AKA Daniel
Re: NET Party with Bricscad.
« Reply #5 on: March 06, 2008, 10:04:39 AM »
fun with forms

Code: [Select]
   [CommandMethodAttribute("doit")]
    public static void test5()
    {
      TestForm form = new TestForm();
      DRXNET.OdAp.Application.ShowModalForm(form);
    }

Code: [Select]
  public partial class TestForm : Form
  {
    AcadApplication app;
    AcadDocument doc;
    AcadDatabase db;
    AcadSummaryInfo suminfo;
    public TestForm()
    {
      InitializeComponent();
      app = (AcadApplication)DRXNET.OdAp.Application.ComApplication;
      doc = app.ActiveDocument;
      db = doc.Database;
      suminfo = db.SummaryInfo;
    }
    private void button1_Click(object sender, EventArgs e)
    {
      this.Close();
    }
    private void TestForm_Load(object sender, EventArgs e)
    {
      this.textBoxTitle.Text = suminfo.Title;
      this.textBoxSubject.Text = suminfo.Subject;
      this.textBoxAuthor.Text = suminfo.Author;
      this.textBoxCategory.Text = "MIA";
      this.textBoxKeyWords.Text = suminfo.Keywords;
      this.richTextBoxComments.Text = suminfo.Comments;
    }
    private void TestForm_FormClosed(object sender, FormClosedEventArgs e)
    {
      suminfo.Title = this.textBoxTitle.Text;
      suminfo.Subject = this.textBoxSubject.Text;
      suminfo.Author = this.textBoxAuthor.Text;
      suminfo.Keywords = this.textBoxKeyWords.Text;
      suminfo.Comments = this.richTextBoxComments.Text;
    }
  }

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8696
  • AKA Daniel
Re: NET Party with Bricscad.
« Reply #6 on: March 09, 2008, 10:03:07 AM »
Here is the latest,

Put these three DLLs in your Bricscad support folder
Appload the DRXNET_2.04_8.DLL the other two will be loaded on demand

You can use the new netload command to load your assemblies, or with lisp (netload_ “path”)

When setting up your .NET projects, reference these three DLL’s and set copy local to false.

I have also attached a sample C# solution, (VS2008 Express)


It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8696
  • AKA Daniel
Re: NET Party with Bricscad.
« Reply #7 on: March 09, 2008, 10:06:38 AM »
more samples

Code: [Select]

[CommandMethodAttribute("DrawCircle1")]
    public static void DrawCircle1()
    {
      SDSResultBuffer rb = new SDSResultBuffer();
      rb.Add(new TypedValue(0, "circle"));
      rb.Add(new TypedValue(62, 5));
      rb.Add(new TypedValue(10, new SDSPoint(0.0, 0.0, 0.0)));
      rb.Add(new TypedValue(40, 10));
      SDSMethods.EntMake(rb);
    }

    [CommandMethodAttribute("DrawCircle2")]
    public static void DrawCircle()
    {
      //new way to get COM instance
      AcadApplication app = (AcadApplication)DRXNET.OdAp.Application.ComApplication;
      if (app == null)
      {
        DRXNET.SDS.SDSMethods.PrintF("\n" + "Doh");
      }
      DRXNET.OdGe.Point3d pt1 = new DRXNET.OdGe.Point3d(0, 0, 0);
      AcadDocument Doc = app.ActiveDocument;
      AcadDatabase Db = Doc.Database;
      AcadCircle myCircle = Db.ModelSpace.AddCircle(pt1.ToArray(), 12);
      myCircle.color = ACAD_COLOR.acCyan;
      myCircle.Update();
    }

    [CommandMethodAttribute("addlayout")]
    public static void addlayout()
    {
      //new way to get COM instance
      AcadApplication app = (AcadApplication)DRXNET.OdAp.Application.ComApplication;
      if (app == null)
      {
        DRXNET.SDS.SDSMethods.PrintF("\n" + "Doh");
      }
      AcadDocument Doc = app.ActiveDocument;
      AcadLayout myLayout = Doc.Layouts.Add("MyLayout");
    }

    [CommandMethodAttribute("myosmode")]
    public static void myosmode()
    {
      //new way to get COM instance
      AcadApplication app = (AcadApplication)DRXNET.OdAp.Application.ComApplication;
      if (app == null)
      {
        DRXNET.SDS.SDSMethods.PrintF("\n" + "Doh");
      }
      AcadDocument Doc = app.ActiveDocument;
      Doc.SetVariable("OSMODE", 191);
    }

 
    [CommandMethodAttribute("myplolyline")]
    public static void myplolyline()
    {
      try
      {
        //new way to get COM instance
        AcadApplication app = (AcadApplication)DRXNET.OdAp.Application.ComApplication;
        if (app == null)
        {
          DRXNET.SDS.SDSMethods.PrintF("\n" + "Doh");
        }
        AcadDocument Doc = app.ActiveDocument;
        AcadDatabase Db = Doc.Database;
        Point2dCollection ptcollection = new Point2dCollection();
        ptcollection.Add(new Point2d(0, 0));
        ptcollection.Add(new Point2d(0, 100));
        ptcollection.Add(new Point2d(100, 100));
        ptcollection.Add(new Point2d(100, 0));
        ptcollection.Add(new Point2d(0, 0));
        List<double> vertexList = new List<double>(10);
        ptcollection.ForEach(p => vertexList.AddRange(p.ToArray()));
        AcadLWPolyline pline = Db.ModelSpace.AddLightWeightPolyline(vertexList.ToArray());

        object omin;
        object omax;
        pline.GetBoundingBox(out omin, out omax);
        double[] min = (double[])omin;
        double[] max = (double[])omax;
        pline.Rotate(new double[] { (max[0] - min[0]), (max[1] - min[1]) }, 0.785398163);
        pline.Update();

      }
      catch (System.Exception ex)
      {
        DRXNET.SDS.SDSMethods.PrintF("\n" + ex.Message);
        DRXNET.SDS.SDSMethods.PrintF("\n" + ex.StackTrace);
      }
    }

MickD

  • King Gator
  • Posts: 3636
  • (x-in)->[process]->(y-out) ... simples!
Re: NET Party with Bricscad.
« Reply #8 on: March 09, 2008, 06:11:05 PM »
Looks like you've been having fun!
I'm a bit too snowed under at the moment to join the fun but I will get there soon, keep up the good work!
"Programming is really just the mundane aspect of expressing a solution to a problem."
- John Carmack

"Short cuts make long delays,' argued Pippin.”
- J.R.R. Tolkien

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8696
  • AKA Daniel
Re: NET Party with Bricscad.
« Reply #9 on: March 09, 2008, 09:04:52 PM »
Hi Mick,
jump in any time! Since there is access to entities via SDS and COM, I’ve decided to wrap the geometry classes first
I’m about halfway done with these classes.

Code: [Select]
OdGeVector2d
OdGePoint2d
OdGeMatrix2d
OdGeVector3d
OdGePoint3d
OdGeMatrix3d

I figure the best way for me to learn an API like DRX is to wrap it,
It forces me to explore every nook ‘n’ cranny. Could take me a few years though  :-o

Helios

  • Guest
Re: NET Party with Bricscad.
« Reply #10 on: March 10, 2008, 05:52:45 AM »
Was trying to APPLOAD DRXNET_2.04_8.DLL  into V8.2.2 Pro but that fails.

I'm new to DRX/SDS but familiar with Bricscad //Acad COM interface.
Currently swapping to .NET C#, trying to find out how to control Bricscad  in a smart (fast) way.

Is the whole key of this DRX/SDS the creation of in-process DLL's?
We need to transfer large amounts of data in/out of a DWG.

TIA.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8696
  • AKA Daniel
Re: NET Party with Bricscad.
« Reply #11 on: March 10, 2008, 06:15:29 AM »
Was trying to APPLOAD DRXNET_2.04_8.DLL  into V8.2.2 Pro but that fails.

I'm new to DRX/SDS but familiar with Bricscad //Acad COM interface.
Currently swapping to .NET C#, trying to find out how to control Bricscad  in a smart (fast) way.

Is the whole key of this DRX/SDS the creation of in-process DLL's?
We need to transfer large amounts of data in/out of a DWG.

TIA.



Hi, Helios & welcome to the Swamp

I have Version 8.1.19 installed on my computer with is the latest shown on the Bricscad site, May ask I where did you got 8.2.2?

Strait DRX will give the best performance, the .NET wrappers that I have written for SDS should be fairly quick, using COM though C# probably would not be any faster than VBA, but that depends on what kind of data your manipulating.

PS are you getting any errors with you load the DLLs?

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8696
  • AKA Daniel
Re: NET Party with Bricscad.
« Reply #12 on: March 10, 2008, 07:18:21 AM »
Helios, can you check your version again and make sure it’s not 8.0.22
These DLL’s would not compatible with anything less than version number 8.1.XXX  as there was a compiler change

Thanks  :-)


It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8696
  • AKA Daniel
Re: NET Party with Bricscad.
« Reply #13 on: March 10, 2008, 09:41:12 AM »
After running a few benchmarks, I found that both COM and SDS ran approximately the same speed, strait DRX was almost twice as fast, and I also ported the DRX over to ObjectARX, where AutoCAD just kicked the carp out of DRX :doa:
« Last Edit: March 10, 2008, 09:59:50 AM by Daniel »

Helios

  • Guest
Re: NET Party with Bricscad.
« Reply #14 on: March 10, 2008, 03:11:21 PM »
Hi Daniel,

thanks for replying.
It's V8.2.2 for sure, I'm a Bricscad Beta tester and get pre-release versions to play with.(Currently 8.1.19-1 is online)
My experience with a VB COM link is that it's dead slow, approx. 10 times slower than VBA which runs inside BricsCad.(Or Acad)
I also have learned that it's important to compile VB routines/programs for the correct Bricscad versions or it'll cause heaps of problems.
Hence my question: does DRX get loaded INTO the Bricscad application? Then I can immagine the comparable speed with VBA.
I've played with ActiveX VB6 DLL's which do the same thing.
Any documentation I can look at to get started?

Helios.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8696
  • AKA Daniel
Re: NET Party with Bricscad.
« Reply #15 on: March 10, 2008, 09:49:26 PM »
Yes, I believe DRX  is running “in process”,  The whole theory is that, the ODA’s DRX SDK can manipulate the DWG database directly in a similar way ObjectARX does, thus I would expect that DRX would be much faster than VBA. We could probably run a few benchmarks to test this theory.

The only supporting documentation for DRX is what comes with the DRX SDK,
http://opendesign.com/node/127
and what comes with Bricscad, in the API folder.

My guess is that they have changed something in the beta version that your running, I hoped they have moved to the latest and greatest version of the ODA libraries. 

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8696
  • AKA Daniel
Re: NET Party with Bricscad.
« Reply #16 on: March 11, 2008, 02:31:46 AM »
Hi, Jerry .... question from the Bricscad fourm

Thanks for trying this out, It seems that I do need to do a little work on SDSMethods.SSget. Anyway without seeing your code it’s hard to see where the problem is. I have written a couple of samples in C# showing the difference between using my SDS wrappers and the COM wrappers. I’ll post this over at the Swamp too so other can see.


Code: [Select]
//com sample
    [CommandMethodAttribute("MySel1")]
    public static void MySel1()
    {
      try
      {
        AcadApplication app = (AcadApplication)DRXNET.OdAp.Application.ComApplication;

        if (app == null)
          DRXNET.SDS.SDSMethods.PrintF("\n" + "Doh");

        AcadDocument Doc = app.ActiveDocument;
        AcadSelectionSet selection = Doc.SelectionSets.Add("test");

        try
        {
          int[] var = new int[] { 0 };
          object[] val = new object[] { "POINT" };
          selection.SelectOnScreen(var, val);

          List<AcadPoint> entlist = new List<AcadPoint>();
          Point3dCollection ptlist = new Point3dCollection();

          foreach (var e in selection)
            entlist.Add((AcadPoint)e);

          entlist.ForEach(e => ptlist.Add(new Point3d((double[])e.Coordinates)));
          ptlist.ForEach(p => DRXNET.SDS.SDSMethods.PrintF(p.ToString()));
        }
        catch
        {
          DRXNET.SDS.SDSMethods.PrintF("\nError Getting Selection set: ");
        }
        finally
        {
          selection.Delete();
        }
      }
      catch (System.Exception ex)
      {
        DRXNET.SDS.SDSMethods.PrintF("\n" + ex.Message);
        DRXNET.SDS.SDSMethods.PrintF("\n" + ex.StackTrace);
      }
    }

    //sds sample
    [CommandMethodAttribute("MySel2")]
    public static void MySel2()
    {
      try
      {
        Point3dCollection ptlist = new Point3dCollection();
        SDSResultBuffer filter = new SDSResultBuffer();
        filter.Add(new TypedValue(0, "POINT"));
        SDSName ss = SDSMethods.SSGet(null, filter);

        if (ss.ID0 == 0 && ss.ID1 == 0)
          DRXNET.SDS.SDSMethods.PrintF("\nError Getting Selection set: ");

        for (int i = 0; i < SDSMethods.SSLength(ss); i++)
        {
          SDSName entname = SDSMethods.SSName(ss, i);
          SDSResultBuffer entlist = SDSMethods.EntGet(entname);
          foreach (TypedValue tv in entlist)
          {
            if (tv.TypeCode == 10)
              ptlist.Add(new Point3d((SDSPoint)tv.Value));
          }
        }
        ptlist.ForEach(p => DRXNET.SDS.SDSMethods.PrintF(p.ToString()));
        SDSMethods.SSFree(ss);
      }
      catch (System.Exception ex)
      {
        DRXNET.SDS.SDSMethods.PrintF("\n" + ex.Message);
        DRXNET.SDS.SDSMethods.PrintF("\n" + ex.StackTrace);
      }
    }

Helios

  • Guest
Re: NET Party with Bricscad.
« Reply #17 on: March 12, 2008, 04:34:33 AM »
Thanks Daniel,

I've downloaded the DRXsdk and have a go with that.
I'll have a play with your tools on V8.1.19.

Helios.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8696
  • AKA Daniel
Re: NET Party with Bricscad.
« Reply #18 on: March 21, 2008, 11:47:37 PM »
I’ve attached new DLLs that should be compatible with Bricscad 8.2.XXX
The new DLLs are compiled against the ODA’s DRX 2.05 libraries




files moved
« Last Edit: August 27, 2008, 09:40:27 PM by Daniel »

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8696
  • AKA Daniel
Re: NET Party with Bricscad.
« Reply #19 on: March 26, 2008, 04:12:42 AM »
 :laugh:

Code: [Select]
//com sample
    [CommandMethodAttribute("extractattribute")]
    public static void extractattribute()
    {
      DateTime TimeStart = DateTime.Now;
      string FileNamePath = @"c:\EvalReport_02.txt";

      StreamWriter LogFile_Obj =
        new StreamWriter(FileNamePath, true, System.Text.Encoding.ASCII);

      LogFile_Obj.AutoFlush = true;
      LogFile_Obj.WriteLine("Starting eval...");

      int countAtts = 0;

      try
      {
        AcadApplication app = DRXNET.OdAp.Application.ComApplication as AcadApplication;

        if (app == null)
          DRXNET.SDS.SDSMethods.PrintF("\n" + "Doh");

        AcadDocument Doc = app.ActiveDocument;
        AcadDatabase db = Doc.Database;

        foreach (AcadObject e in db.ModelSpace)
        {
          if (e.ObjectName == "AcDbBlockReference")
          {
            AcadBlockReference blockReference = (AcadBlockReference)e;

            if (blockReference.HasAttributes == true && blockReference.Layer == "1_8_TEXT")
            {
              foreach (AcadAttributeReference attributeReference in
                blockReference.GetAttributes() as Object[])
              {
                countAtts++;
                LogFile_Obj.WriteLine(countAtts.ToString() + '\t' +
                      attributeReference.TagString + '\t' + attributeReference.TextString);

              }
            }
          }
        }
        TimeSpan TimeDuration = (DateTime.Now - TimeStart);

        DRXNET.SDS.SDSMethods.PrintF("\nProcess time: " +
          TimeDuration.TotalSeconds.ToString());

        LogFile_Obj.WriteLine(("End eval...Process time: " +
          TimeDuration.TotalSeconds.ToString() + " Seconds"));

      }
      catch (System.Exception ex)
      {
        DRXNET.SDS.SDSMethods.PrintF("\n" + ex.Message);
        DRXNET.SDS.SDSMethods.PrintF("\n" + ex.StackTrace);
      }
      finally
      {
        LogFile_Obj.Close();
      }
    }
« Last Edit: March 26, 2008, 04:36:45 AM by Daniel »

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: NET Party with Bricscad.
« Reply #20 on: March 26, 2008, 04:24:34 AM »
Hi Dan !

AcadApplication ????
       AcadDocument Doc = app.ActiveDocument;
        AcadDatabase db = Doc.Database;

seems to be a little polution in the namespaces and types ? 
 :|

that code looks familiar on several levels  :-)





kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8696
  • AKA Daniel
Re: NET Party with Bricscad.
« Reply #21 on: March 26, 2008, 04:45:54 AM »
Hi Dan !

AcadApplication ????
       AcadDocument Doc = app.ActiveDocument;
        AcadDatabase db = Doc.Database;

seems to be a little polution in the namespaces and types ? 
 :|



I know,  I think it used to be IcadApplication, but that changed when some of the clones started using the OpenDWG libraries to access the database

BTY the time was about 3 seconds  :-D
« Last Edit: March 26, 2008, 05:36:34 AM by Daniel »

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8696
  • AKA Daniel
Re: NET Party with Bricscad.
« Reply #22 on: March 26, 2008, 05:37:34 AM »
that code looks familiar on several levels  :-)

And it should, I lifted most of it from you  :-o
I hope you don’t mind  :?

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: NET Party with Bricscad.
« Reply #23 on: March 26, 2008, 06:00:05 AM »
that code looks familiar on several levels  :-)

And it should, I lifted most of it from you  :-o
I hope you don’t mind  :?

don't be silly ;-) 
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8696
  • AKA Daniel
Re: NET Party with Bricscad.
« Reply #24 on: April 17, 2008, 10:41:20 AM »
Here are some new DLLs. Kudos to Bricscad for fixing the issues with mixed managed/unmanaged modules . these are for 8.2.8++

« Last Edit: August 27, 2008, 01:51:25 PM by Daniel »

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8696
  • AKA Daniel
Re: NET Party with Bricscad.
« Reply #25 on: May 06, 2008, 02:15:28 PM »
Here are some new DLL’s to play with. 
The way I was passing strings between managed & unmanaged memory was flawed, I think I have this fixed.
GetVar() and SetVar() now consume/return a boxed object instead of a result buffer, I did this so I could delete the unmanaged resources quickly
I did some work on the ObjectId Class that wraps OdDbObjectId, It now has constructors and operators to translate between SDSName, ActiveX ObjectId (long) and OdDbObjectId

example

Code: [Select]
    [CommandMethodAttribute("doit1")]
    public static void doit1()
    {
      AcadApplication app = (AcadApplication)DRXNET.OdAp.Application.ComApplication;
      if (app == null)
        DRXNET.SDS.SDSMethods.PrintF("\n" + "Doh");

      AcadDocument Doc = app.ActiveDocument;
      AcadSelectionSet selection = Doc.SelectionSets.Add("test");

      SDSResultBuffer buff = null;

      try
      {
        int[] var = new int[] { 0 };
        object[] val = new object[] { "LWPOLYLINE" };

        selection.SelectOnScreen(var, val);

        List<AcadLWPolyline> entlist = new List<AcadLWPolyline>();

        foreach (var e in selection)
          entlist.Add((AcadLWPolyline)e);

        ObjectId id = new ObjectId(entlist[0].ObjectID);//constructor for long int

        DRXNET.SDS.SDSMethods.PrintF("\n" + id.ToString());
        DRXNET.SDS.SDSMethods.PrintF("\n" + id.IsValid.ToString());
        DRXNET.SDS.SDSMethods.PrintF("\n" + id.sdsName.ToString());
   
        buff = SDSMethods.EntGet(id); //implicit operator to sdsname

        DRXNET.SDS.SDSMethods.PrintF("\n" + buff.ToString());
      }
      catch (System.Exception ex)
      {
        DRXNET.SDS.SDSMethods.PrintF("\n" + ex.Message);
        DRXNET.SDS.SDSMethods.PrintF("\n" + ex.StackTrace);
      }
      finally
      {
        selection.Delete();
        buff.Dispose();
      }
    }

still have lots of work todo
« Last Edit: August 27, 2008, 01:50:56 PM by Daniel »

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8696
  • AKA Daniel
Re: NET Party with Bricscad.
« Reply #26 on: August 27, 2008, 02:00:51 PM »
I’ve updated the DLLs , included a version for the new beta (v9)and attached them along with C# solution with a few com samples. Still a work in progress

Instructions:
Put these three DLLs in your Bricscad support folder
Appload the DRXNET_2.0X_8.DLL the other two will be loaded on demand
You can use the new netload command to load your assemblies, or with lisp (netload_ “path”)

quick sample

Code: [Select]
  [CommandMethod("addlayout")]
    public static void addlayout()
    {
      try
      {
        AcadApplication application = DRXNET.OdAp.Application.AcadApplication as AcadApplication;
        if (application == null)
          throw new System.Exception("Could Not Get Application");

        AcadDocument document = application.ActiveDocument;
        AcadLayout myLayout = document.Layouts.Add("MyLayout");
      }
      catch (System.Exception ex)
      {
        System.Windows.Forms.MessageBox.Show(ex.Message);
      }
    }



Spike Wilbury

  • Guest
Re: NET Party with Bricscad.
« Reply #27 on: August 27, 2008, 02:19:39 PM »
Daniel,

Any idea how the lisp routines are protected, do they have something similar like fas/vlx files now? (with their LispEx)

Just curiosity for now...

Thanks.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8696
  • AKA Daniel
Re: NET Party with Bricscad.
« Reply #28 on: August 27, 2008, 02:26:52 PM »
Daniel,

Any idea how the lisp routines are protected, do they have something similar like fas/vlx files now? (with their LispEx)

Just curiosity for now...

Thanks.

Last I heard, they were working on some sort of encryption mechanism, but I haven’t followed it up.
The New DRX API is pretty slick, I still want to play with BRX too once they get that released. All in all, it’s cool stuff.

Spike Wilbury

  • Guest
Re: NET Party with Bricscad.
« Reply #29 on: August 27, 2008, 02:32:44 PM »
Daniel,

Any idea how the lisp routines are protected, do they have something similar like fas/vlx files now? (with their LispEx)

Just curiosity for now...

Thanks.

Last I heard, they were working on some sort of encryption mechanism, but I haven’t followed it up.
The New DRX API is pretty slick, I still want to play with BRX too once they get that released. All in all, it’s cool stuff.


Thanks.

BRX ?

never mind, found the info here

http://www.deelip.com/2008/03/new-clone-on-block.html
« Last Edit: August 27, 2008, 02:35:56 PM by LE »

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8696
  • AKA Daniel
Re: NET Party with Bricscad.
« Reply #30 on: August 27, 2008, 02:35:56 PM »
[BRX ?

Supposedly, you can compile existing ARX code to BRX just by changing your environment settings in Visual studio. 

Spike Wilbury

  • Guest
Re: NET Party with Bricscad.
« Reply #31 on: August 27, 2008, 03:09:42 PM »
[BRX ?

Supposedly, you can compile existing ARX code to BRX just by changing your environment settings in Visual studio. 

Thanks, that sounds very good!

Helios

  • Guest
Re: NET Party with Bricscad.
« Reply #32 on: June 09, 2009, 05:11:28 AM »
Daniel,

Been partying a bit more in Bricscad 9.2.15 with your NETLOAD tools.
I get very nice results, performance is more than fast enough.
Was wondering : Putting a netload command in On_start.lsp brings up the filedialog even when using an underscore:
(command "_.netload" "c:\\NetPartyByDaniel.dll")

Is there a way to suppress the filedialog and use the filename as embedded in the command?
Or would that demand (another) efford from your side?

Helios

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8696
  • AKA Daniel
Re: NET Party with Bricscad.
« Reply #33 on: June 09, 2009, 05:49:54 AM »
try using (netload_ “path”) ..
are you using the pro version? if so I have alll new .net stuff to play with :laugh:

Helios

  • Guest
Re: NET Party with Bricscad.
« Reply #34 on: June 09, 2009, 10:39:24 AM »
Thanks Daniel,
your suggestion works.

Yes, I'm using the Pro version.
You mentioned 'new stuff'???
Would love to have a crack with that.

Helios

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8696
  • AKA Daniel
Re: NET Party with Bricscad.
« Reply #35 on: June 09, 2009, 11:06:12 AM »
Great! let me package up what I have and write up some notes. I was waiting for the Bricscad version that's in beta now to be released as it contains the fixes needed for the lisp methods to work, but the command methods should work slightly faster..   :-)

Dinosaur

  • Guest
Re: NET Party with Bricscad.
« Reply #36 on: June 09, 2009, 11:28:35 AM »
Sounds like fun ... whenever you are ready to turn them loose my v9 pro is ready and waiting to join the party.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8696
  • AKA Daniel
Re: NET Party with Bricscad.
« Reply #37 on: June 10, 2009, 12:08:21 AM »