Is Arx ng right place to ask .Net ques?

Discussion in 'AutoCAD' started by Mark Propst, Jan 17, 2004.

  1. Mark Propst

    Mark Propst Guest

    Is Arx ng right place to ask .Net ques?

    (re: acadx site samples)

    gee how did this type get so small?

    tks

    me
     
    Mark Propst, Jan 17, 2004
    #1
  2. No, not really. .NET is just another way to access
    AutoCAD's ActiveX API, which has nothing to do with
    ObjectARX.
     
    Tony Tanzillo, Jan 17, 2004
    #2
  3. Mark Propst

    Mark Propst Guest

    so is there an appropriate forum anyone knows of?
     
    Mark Propst, Jan 18, 2004
    #3
  4. No, not that I'm aware of.
     
    Tony Tanzillo, Jan 18, 2004
    #4
  5. Mark Propst

    Mark Propst Guest

    Thanks Tony,
    :-(
    Guess it's back to the good ol f1 group;-)
     
    Mark Propst, Jan 18, 2004
    #5
  6. This is as close as it gets for now. What's up?

    --
    There are 10 kinds of people. Those who understand binary and those who
    don't.

    http://code.acadx.com
    (Pull the pin to reply)
     
    Frank Oquendo, Jan 19, 2004
    #6
  7. Mark Propst

    Mark Propst Guest

    Hi Frank,
    after posting this to the arx grp I realized I really need to bone up on the
    ..net fundamentals since I don't meet the prerequisties of your posted sample
    I was trying (familiarity with c#)
    so feel free to ignore my question if you like.
    I've obviously got a big learning curve ahead of me.
    However, I've seen more and more 'chatter' about .Net, even on these acad
    groups about it being so great so i figured I should try to catch up with
    the future!

    This is a copy of my orig post to arx grp.
    <snip>
    I've been reading and trying the samples at acadx.com, Thanks, Frank...
    I got the interopassemblydll dealybopper and then tried the autocadconnector
    example.
    Using the code as posted does start a console window, then acad, (after
    substantial delay) then shuts
    down acad as apparently intended in the sample.(per the using directive)

    I tried to extend the sample by opening an existing dwg and cant' seem to
    figure it out.
    here's what I tried:
    using System;
    using AcadConnect;///(my name for AcadExample in the sample)
    using AutoCAD;

    namespace ConsoleApplication1

    {

    class Class1

    {

    [STAThread]

    static void Main(string[] args)

    {

    using (AutoCADConnector connector = new AutoCADConnector())

    {

    Console.WriteLine(connector.Application.ActiveDocument.Name);

    ///tried this first

    ///connector.Application.Open ("C:\\0\\0dwgs\\church\\church.dwg");

    ///but got error "no Open method in Application object, use .Documents.Open
    instead"

    ///so i tried this:

    ///connector.Application.Documents.Add ("C:\\0\\0dwgs\\church\\church.dwg");

    ///and also tried this:

    ///connector.Application.Documents.Open
    ("C:\\0\\0dwgs\\church\\church.dwg");

    ///and got error "no Documents property in Application"...or something like
    that

    ///intellisense sees a Documents property but it won't run

    ///and since the connector.Application has an .Application object I tried
    that too

    ///connector.Application.Application.Documents.Open
    ("C:\\0\\0dwgs\\church\\church.dwg");

    /// but still get the 'No documents' error...

    }

    Console.ReadLine();

    }

    }

    }


    Also I'm a bit confused about what I should be trying to learn here. If
    Autocad doesn't support .Net should I be going with c++ and ObjectArx? But
    I've seen mention of using .Net with com wrappers (which I only fuzzily
    understand the idea of). I've seen several people saying they love .Net but
    how to go about getting hold of an instance of Acad, opening or creating a
    specific drawing, and adding or manipulating native acad objects???
     
    Mark Propst, Jan 19, 2004
    #7
  8. This book will get you on the right track: http://snipurl.com/3xcr
    Although they won't say when, Autodesk has hinted at a native .NET API
    for AutoCAD. Their Envision product already has one.
    Strange error alright but you would have crashed anyway. Frankly, I'm
    surprised it compiled. Using A2K4, the Open method expects three
    parameters, not just one. The first is the file path, the second is a
    bool indicating whether to open the file as readonly and the last is a
    password.

    Which version of AutoCAD are you programming for and did you reference
    the correct type library?
    That's for new files only. The parameter is supposed to be a template
    name.
    ObjectARX is amazingly powerful but it's also incredibly complex. .NET
    is a much easier arena to enter and the OOP concepts you learn can serve
    as a stepping stone to C++.
    COM wrappers are just .NET's way of leveraging all those existing
    ActiveX APIs like the one offered by AutoCAD.

    If you continue to have problems, be sure to post and we'll walk through
    through your code. BTW, as a test, I would suggest you ditch my example
    and see if your problems disappear once you connect to AutoCAD manually.

    --
    There are 10 kinds of people. Those who understand binary and those who
    don't.

    http://code.acadx.com
    (Pull the pin to reply)
     
    Frank Oquendo, Jan 19, 2004
    #8
  9. Mark Propst

    Mark Propst Guest

    Hi Frank,
    Thanks for the response

    a2k2 for now...

    although your example said to reference the acad lib in the Com tab, I had
    gone through your Interop dll example, connecting to acad events.. so I
    downloaded your dll and referenced that from the .net tab.
     
    Mark Propst, Jan 19, 2004
    #9
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.