Author Topic: Bricscad && .NET  (Read 90996 times)

0 Members and 1 Guest are viewing this topic.

MickD

  • King Gator
  • Posts: 3636
  • (x-in)->[process]->(y-out) ... simples!
Re: Bricscad && .NET
« Reply #60 on: February 04, 2010, 02:15:31 AM »
I'm pretty keen to work with Bricscad but without the hlr engine (the engine used for SOLPROF etc) it is a big draw back for what I need to do.
As soon as they implement that and have the .net api I'll be there in a flash :)
"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: 8691
  • AKA Daniel
Re: Bricscad && .NET
« Reply #61 on: April 12, 2010, 10:05:30 PM »
Update: I posted a version compiled with  .NET 4 (Release), see the first post in this thread.  :-)

Dan

Jerry J

  • Newt
  • Posts: 48
Re: Bricscad && .NET
« Reply #62 on: May 14, 2010, 04:27:17 AM »
Daniel   I get this warning in C# Express.

Warning   1   A reference was created to embedded interop assembly 'c:\Program Files\RxNet\V10\Interop.BricscadDb.10.0.dll' because of an indirect reference to that assembly created by assembly 'c:\Program Files\RxNet\V10\RxNet.dll'. Consider changing the 'Embed Interop Types' property on either assembly.   

Since I am ignorant as to compiler reference jargon I was wondering if I should do as recommended to RxNet by setting to True or the Interops to false? Just figured you'd know off the top of your head.

Jerry


It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8691
  • AKA Daniel
Re: Bricscad && .NET
« Reply #63 on: May 14, 2010, 04:49:16 AM »
... you can remove the references to the DLLs I provided and add your own though the com tab.. use the default settings


Jerry J

  • Newt
  • Posts: 48
Re: Bricscad && .NET
« Reply #64 on: May 23, 2010, 04:02:04 AM »
Daniel

Was looking thru some of your samples in NativeMethods.cs in RxNetSamples and have a question.  I see you are now using dllimport of "brx10.dll" rather than "bricscad.exe".  I could not get C# express to find the file, whereas bricscad.exe - no problem.  I was just invoking grdraw as it appears missing in com.  Did you go to brx10.dll because the future of calling sds_grdraw (for instance) may go away in the future? or ..  The function would be acedGrDraw in brx10.dll. 

Do I need to copy brx10.dll to the C# project folder?  Was going to be invoking grread as well, but even in lisp the function is unclear to me.  Is there a buffer that needs to be flushed when tracking coords?  or it just taking a snapshot and assigning to my varriable? 

The routine I'm playing with is to read objects Z value on mouse over and indicate %Grade from some given point.  Used it for "pioneering" roadway layout and found it handy.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8691
  • AKA Daniel
Re: Bricscad && .NET
« Reply #65 on: May 23, 2010, 07:16:40 AM »
if it's a BRX  function you would p/invoke from BRX10.dll, if it's a SDS function p/invoke from Bricscad.exe. I don't think the SDS version will go away anytime soon.
 Let me see what it will take to wrap these functions for you, grread might be a little difficult.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8691
  • AKA Daniel
Re: Bricscad && .NET
« Reply #66 on: May 23, 2010, 09:08:22 PM »
Hi Jerry,

I've updated install attached to the first post in this thread..

heres a sample

Code: [Select]
using System;
//
using BricscadApp;
using BricscadDb;
using RxNet.ApplicationServices;
using RxNet.Runtime;
using RxNet.RxGlobal;
using RxNet.Geometry;
using RxNet.DatabaseServices;
using RxNet.Editor;


namespace Bricscad
{
  public static class Commands
  {
    [CommandMethod("doit")]
    public static void test01()
    {
      var app = Application.AcadApplication as AcadApplication;
      var doc = app.ActiveDocument;
      try
      {
        bool doloop = true;
        Point3d last = Point3d.kOrigin;
        while (doloop)
        {
          GrReadResult res = GlobalFunctions.GrRead(1);
          if (res.Buffer.TypeCode == (short)LispDataType.Point3d)
          {
            Point3d next = (Point3d)res.Buffer.Value;
            GlobalFunctions.GrDraw(last, next, 6, 0);
            last = next;
          }
          //doc.Utility.Prompt(String.Format("\n{0},{1}", res.AnswerType , res.Buffer));
          if (res.Status == PromptStatus.Cancel)
            doloop = false;
        }
      }
      catch (System.Exception ex)
      {
        doc.Utility.Prompt(String.Format("\n{0}", ex.Message));
      }
    }
  }
}



Daniel Eiszele

  • Newt
  • Posts: 85
Re: Bricscad && .NET
« Reply #67 on: May 24, 2010, 06:03:42 AM »
Hi Dan, any chance of updating the 1.010 version as well?  I am using Delphi prism for my .NET fun and don't have access to the V4 framework. Can't wait till Bricsys support a full .NET implementation but in the mean time your libraries make things far more accessible than COM alone can.  I've said it before but great work!

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8691
  • AKA Daniel
Re: Bricscad && .NET
« Reply #68 on: May 24, 2010, 06:07:40 AM »
Hi Dan, any chance of updating the 1.010 version as well? 

Yep, I will post it in a couple of hours  8-)

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8691
  • AKA Daniel
Re: Bricscad && .NET
« Reply #69 on: May 24, 2010, 06:36:12 AM »
Hey Daniel,

I've posted it, let me know of you run into any issues.

Daniel Eiszele

  • Newt
  • Posts: 85
Re: Bricscad && .NET
« Reply #70 on: May 24, 2010, 06:50:45 AM »
Thanks Dan, are you operating out of the Tardis?  That couple of hours only seemed like 20 minutes  :lol:

Jerry J

  • Newt
  • Posts: 48
Re: Bricscad && .NET
« Reply #71 on: May 24, 2010, 07:26:05 AM »
Thanks a bunch!

Still wondering why I could p\invoke "bricscad.exe" but said it coun't find "brx10.dll"? So I ran dependency walker which came up with all sorts of can't finds on brx10.dll and just two on bricscad.exe.  A couple of the missing dependencies were MFC and ATL which don't come in the express versions so maybe thats why?  Just curious, since I would think that brx10.dll was already loaded by the time I netload my app.

Anyway this will be fun.  Now I can play with all that cool grread stuff that Andrea is doing in lisp.

Daniel Eiszele

  • Newt
  • Posts: 85
Re: Bricscad && .NET
« Reply #72 on: May 24, 2010, 07:36:57 AM »
Hi Dan, is there any chance you converted the 1.01-2 version to Net 4 as well?  I have tried referencing it but it wont load as VS tells me it's created with a newer runtime than I have loaded.  I believe I am using 3.5; but I am new to the .Net thing and I might be doing something else incorrectly?

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8691
  • AKA Daniel
Re: Bricscad && .NET
« Reply #73 on: May 24, 2010, 08:15:02 AM »
Hi Dan, is there any chance you converted the 1.01-2 version to Net 4 as well?  I have tried referencing it but it wont load as VS tells me it's created with a newer runtime than I have loaded.  I believe I am using 3.5; but I am new to the .Net thing and I might be doing something else incorrectly?

try it now  :-)

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8691
  • AKA Daniel
Re: Bricscad && .NET
« Reply #74 on: May 24, 2010, 08:23:50 AM »
Thanks a bunch!

Still wondering why I could p\invoke "bricscad.exe" but said it coun't find "brx10.dll"? So I ran dependency walker which came up with all sorts of can't finds on brx10.dll and just two on bricscad.exe.  A couple of the missing dependencies were MFC and ATL which don't come in the express versions so maybe thats why?  Just curious, since I would think that brx10.dll was already loaded by the time I netload my app.

Anyway this will be fun.  Now I can play with all that cool grread stuff that Andrea is doing in lisp.

My Pleasure  :-)
Hard to say without seeing the code, it could be that you had a bad entry point or the signature was invalid.
It's really easy for me to add these in, just holler if you need something else