Author Topic: IronScheme 1.0 Beta 1  (Read 4351 times)

0 Members and 1 Guest are viewing this topic.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
IronScheme 1.0 Beta 1
« on: October 25, 2008, 01:05:06 AM »
« Last Edit: October 25, 2008, 01:10:25 AM by MP »
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: 8659
  • AKA Daniel
Re: IronScheme 1.0 Beta 1
« Reply #1 on: October 25, 2008, 12:59:31 PM »
Can we make it work in AutoCAD?  :laugh:

tjr

  • Guest
Re: IronScheme 1.0 Beta 1
« Reply #2 on: October 27, 2008, 10:09:50 AM »
Yes, this could be made to work with AutoCAD.

If one where to update the code I have for PyAcad.NET to use IronPython 2.X code you could run IronPython, IronRuby and IronScheme from PyAcad.NET as all make use of the DLR provided in IronPython's code base.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8659
  • AKA Daniel
Re: IronScheme 1.0 Beta 1
« Reply #3 on: October 27, 2008, 10:59:54 AM »
I tried to do it but it didn’t work. I’ll wait till L sharp v2 is released and try that.

tjr

  • Guest
Re: IronScheme 1.0 Beta 1
« Reply #4 on: October 27, 2008, 11:06:29 AM »
Can you post the code you used? 2.x is a very different beast than 1.x.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8659
  • AKA Daniel
Re: IronScheme 1.0 Beta 1
« Reply #5 on: October 27, 2008, 11:42:47 AM »
Nothing to show really, I tried to evaluate a few commands as show in this thread but failed.
http://www.codeplex.com/IronScheme/Thread/View.aspx?ThreadId=36625

 There is zero documentation to go off of.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8659
  • AKA Daniel
Re: IronScheme 1.0 Beta 1
« Reply #6 on: October 27, 2008, 12:00:47 PM »
this works

Code: [Select]
#region
using System;
using System.Collections;
using System.Collections.Generic;
using System.Windows.Forms;
using System.IO;
using System.Text;
using System.Runtime.InteropServices;

using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.EditorInput;

using AcEd = Autodesk.AutoCAD.EditorInput;
using AcAp = Autodesk.AutoCAD.ApplicationServices;

using IronScheme;
using IronScheme.Hosting;
using IronScheme.Runtime;
using Microsoft.Scripting;
using Microsoft.Scripting.Hosting;


#endregion

[assembly: CommandClass(typeof(LispAcadDotNet.AcadInterface))]
namespace LispAcadDotNet
{
  public class AcadInterface
  {
    [CommandMethod("doit")]
    public static void doit()
    {
      ScriptDomainManager mgr = ScriptDomainManager.CurrentManager;
      IronSchemeLanguageProvider slp = new IronSchemeLanguageProvider(mgr);
      ScriptEngine se = slp.GetEngine();
      IronScheme.Runtime.Builtins.Load("~/ironscheme.boot.pp");
      AcAp.Application.DocumentManager.MdiActiveDocument.Editor.WriteMessage("{0}",
      se.Evaluate( String.Format( "(eval-r6rs {0})", "(+ 1 2 )")));
    }
  }
}


MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: IronScheme 1.0 Beta 1
« Reply #7 on: October 27, 2008, 02:36:26 PM »
Pretty cool you guys, pretty cool.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

tjr

  • Guest
Re: IronScheme 1.0 Beta 1
« Reply #8 on: October 27, 2008, 02:50:36 PM »
Very cool Dan.

Wonder what it would take to update my IronPython AutoCAD embedding up to 2.0 DLR, include this code and also get IronRuby embedding in the same DLL. It would be need to have "runpyfile", "runrbfile" and "runscfile" from the same DLL, embedding the 3 languages.

Perhaps after I figure out my table issue I will try my hand at it. Unless someone gets there first. (looks at Dan).

MickD

  • King Gator
  • Posts: 3619
  • (x-in)->[process]->(y-out) ... simples!
Re: IronScheme 1.0 Beta 1
« Reply #9 on: November 13, 2008, 04:10:25 AM »
perhaps something along these lines Tim -

http://blogs.msdn.com/seshadripv/archive/2008/06/30/how-to-invoke-a-python-function-from-c-using-the-dlr-hosting-api.aspx

just replace 'string pyFunc' with the python file text and a bit of parsing to find the method names and register the commands, there may even already be a 'pyEng.CreateScriptSourceFromFile' method (I'd like to think so anyway).

this may be a band aid also - https://blogs.msdn.com/seshadripv/archive/2008/06/24/how-to-write-a-simple-dlr-host-in-c-using-hosting-api.aspx

I was thiking of having C# look up the file names and use them as the commands, each file performs just one task/command and C# just needs to look up the files at loading.
Just a thought...:)
"Short cuts make long delays,' argued Pippin.”
J.R.R. Tolkien