Author Topic: Extending AutoLisp - Let's start with format  (Read 11631 times)

0 Members and 1 Guest are viewing this topic.

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: Extending AutoLisp - Let's start with format
« Reply #15 on: August 15, 2011, 11:42:34 AM »
BTW, is there some form of reflection on Arx like you get with Net? Previously I thought this should have been possible quite easily by implementing a similar idea as the vlax-import-type-library does. If there's no reflection, then I can't really see a simple way of doing this.
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

John Kaul (Se7en)

  • Administrator
  • Needs a day job
  • Posts: 9297
Re: Extending AutoLisp - Let's start with format
« Reply #16 on: August 15, 2011, 11:51:51 AM »
For the sake of this conversation: ARX == COM. ...COM is a no-go on *nix.

I'm trying to find `some form of RPC' we can use but I still don't have access to the lisp interpreter--which is in ACAD.EXE BTW--and I doubt we will find or create one (I'm just not good enough to do anything like that).  We would better off communicating via txt files, or using SOAP (communicate via XML) between C++ and Lisp applications.

I gotta run. I'll check back later.
“Common sense is not so common.” ~Voltaire

--> Donate to TheSwamp.org <--

John Kaul (Se7en)

  • Administrator
  • Needs a day job
  • Posts: 9297
Re: Extending AutoLisp - Let's start with format
« Reply #17 on: August 15, 2011, 11:52:53 AM »
Sorry, I don't know what reflection is so I don't know.
“Common sense is not so common.” ~Voltaire

--> Donate to TheSwamp.org <--

dgorsman

  • Water Moccasin
  • Posts: 2402
Re: Extending AutoLisp - Let's start with format
« Reply #18 on: August 15, 2011, 12:09:10 PM »
System.Reflection namespace

Handy little corner of the .NET environment.  Haven't played with it yet, but I've seen others use it for doing things programatically at run-time rather than having to make decisions when writing code.
If you are going to fly by the seat of your pants, expect friction burns.

try {GreatPower;}
   catch (notResponsible)
      {NextTime(PlanAhead);}
   finally
      {MasterBasics;}

John Kaul (Se7en)

  • Administrator
  • Needs a day job
  • Posts: 9297
Re: Extending AutoLisp - Let's start with format
« Reply #19 on: August 15, 2011, 12:40:55 PM »
Thanks for the link dgorsman.

C++ (more specifically, the LLVM/CLANG compiler does JIT [just in time] compilation) but I'm not quite sure I know where you are going with this (JIT is used to increase runtime performance).
“Common sense is not so common.” ~Voltaire

--> Donate to TheSwamp.org <--

John Kaul (Se7en)

  • Administrator
  • Needs a day job
  • Posts: 9297
Re: Extending AutoLisp - Let's start with format
« Reply #20 on: August 15, 2011, 02:20:25 PM »
Okay, I've re-read this thread and I think I should clarify my thoughts.

An ARX is an ActiveX DLL (nothing new here; everyone knows that). ActiveX is basically COM (to be a bit more specific; "you need COM to do ActiveX" ...maybe that's a better way of saying it). We can't make ARX's in *nix (Linux or Unix) and I doubt OS X (Mac) either because we don't have COM.

So we need a way for AutoLisp to talk to something written in C++. This is what I've been looking for; a way for me to pass information to and from with plain C++. If we can get a "communications channel" open we can *MAYBE* fix one of the other Lisp implementations you have found to use `it' (but if you have the ability to share information, I don't see the need to implement anything further; just make some functions/classes/etc available to lisp--think: "public" and "retval" in VB).

FWIW, Porting this mythical `communications channel' to Windows, Mac, and Linux is not just a small problem either.

Also, the methods and functions you have available to you are all--well, most of them--in the VL.ARX. This, as we know now, is just a fancy COM server (AutoCAD is the client). The COM subject is a rabbit hole to say the least. For example: I'm sure you have seen discussions on if you should release your objects or not "(vlax-release-object)". No one besides Autodesk knows this for sure because AutoCAD is the "COM client" and it needs to do the actual Releasing. I guess another way to think about that would be: what you are doing in AutoLisp is just saying that you don't need the communications channel open any longer. Whether or not AutoCAD is closing the COM channel is not available to you, nor should it. COM is extremely fickle. If you don't create and release properly, you can do some major damage.

I don't for sure, because I don't really care about Mac versions so I don't pay attention, but I would imagine that Autodesk is saying something like: "only vanilla AutoLisp is working in Mac versions"...well, we know that is all they could ever say at this point because they would have to use a different IPC mechanism for all those VL functions.

So we have a few choices, we either invent a new method for sharing information, use an existing one, or make a standard library.  ...I vote standard library. This way everyone can contribute.


I need to do some more reading.
« Last Edit: August 15, 2011, 05:30:43 PM by Se7en »
“Common sense is not so common.” ~Voltaire

--> Donate to TheSwamp.org <--

LE3

  • Guest
Re: Extending AutoLisp - Let's start with format
« Reply #21 on: August 15, 2011, 03:03:33 PM »
Nope, it is a dynamic library that it is rename to arx, then it accessed via the entrypoint, for com you have to make your project be ATL - something that it is available via the arx wizard from the sdk, where you can built your skeleton much easier. hth

John Kaul (Se7en)

  • Administrator
  • Needs a day job
  • Posts: 9297
Re: Extending AutoLisp - Let's start with format
« Reply #22 on: August 15, 2011, 04:04:40 PM »
are there any options for us in *nix you see LE?
“Common sense is not so common.” ~Voltaire

--> Donate to TheSwamp.org <--

John Kaul (Se7en)

  • Administrator
  • Needs a day job
  • Posts: 9297
Re: Extending AutoLisp - Let's start with format
« Reply #23 on: August 15, 2011, 04:39:55 PM »
Oh, I think I see what you are talking about (I found some ARX source code). It is just a DLL. ...MinGW wont be able to compile this.

I'm gonna download Visual Studio Express and the Autodesk SDK now.
“Common sense is not so common.” ~Voltaire

--> Donate to TheSwamp.org <--

Jeff H

  • Needs a day job
  • Posts: 6055
Re: Extending AutoLisp - Let's start with format
« Reply #24 on: August 15, 2011, 07:45:08 PM »
I do not know what all is or not supported for MAC of course COM and GUI components are examples that will limit your library unless you are wanting to support 2 wich I guess you will anyways at least compling the code for each.

John Kaul (Se7en)

  • Administrator
  • Needs a day job
  • Posts: 9297
Re: Extending AutoLisp - Let's start with format
« Reply #25 on: August 15, 2011, 07:59:41 PM »
*sigh* I thought I had it all figured out. I thought I figured out a way to create a DLL with MinGW that could be called from lisp (this was to reproduce the non-com arx's PeterGabriel told us about). ...I hit not just one brick wall but three. *sigh*
“Common sense is not so common.” ~Voltaire

--> Donate to TheSwamp.org <--

Jeff H

  • Needs a day job
  • Posts: 6055
Re: Extending AutoLisp - Let's start with format
« Reply #26 on: August 15, 2011, 08:03:59 PM »
The attachment might shed some light
 
 
 

LE3

  • Guest
Re: Extending AutoLisp - Let's start with format
« Reply #27 on: August 15, 2011, 11:10:23 PM »
are there any options for us in *nix you see LE?

The only info I have is this:
http://www.youtube.com/watch?v=los4uycOMJg&feature=player_embedded

From here:
http://arxformac.blogspot.com/

I remember reading a list (from a knowledge base about autocad mac)... of what it is supported and not, but lost the url link... all they say that autolisp is available as long there is no dcl, objectarx is available as long no mfc it is involved... etc.

HTH

LE3

  • Guest
Re: Extending AutoLisp - Let's start with format
« Reply #28 on: August 15, 2011, 11:43:52 PM »
Oh, I think I see what you are talking about (I found some ARX source code). It is just a DLL. ...MinGW wont be able to compile this.

I'm gonna download Visual Studio Express and the Autodesk SDK now.

I remember that was a way or a workaround for this, but again lost the url link... arx it is supported for visual studio pro/standard versions since they required the mfc libraries.... afaik - go to the dev center of autodesk: www.objectarx.com - for more info.