Author Topic: Auto Lisp to C# Conversion  (Read 3648 times)

0 Members and 1 Guest are viewing this topic.

Wwes

  • Guest
Auto Lisp to C# Conversion
« on: May 06, 2016, 11:19:48 AM »
I am making the transition from using autolisp for scripting to using C# on visual Studio, Is there a way for me to migrate my current code from Auto Lisp to C#
I am kind of looking for a way to the see the translated actions of things i already did in lisp  to boost my C# literacy.

Atook

  • Swamp Rat
  • Posts: 1027
  • AKA Tim
Re: Auto Lisp to C# Conversion
« Reply #1 on: May 06, 2016, 11:47:39 AM »
I haven't written much LISP, though I'm familiar with C#.

C# isn't a scripting language, in my understanding it interacts with CAD in a different manner than LISP. You may be able to use some of the logic from your LISP code, but as far as I know there is to tool for LISP/.NET translation.

As others have said, if you're migrating to C# you should get familiar with C#/.NET first, then start applying it to AutoCAD.

Wwes

  • Guest
Re: Auto Lisp to C# Conversion
« Reply #2 on: May 06, 2016, 12:23:26 PM »
Thanks for the Advice
I am currently trying to figure out how to use visual studio community 2015 to create C# addins for autoCAD and AutoDesk Fabriaction CADmep
i am kind of getting hung up on adding the correct references to AutoCAD and fabrication, i feel like i have all the documentation necessary to figure this out, but once i do i didnt want to stare at the blank screen and wonder what code to write, so i had the idea of trying to translate the lisp routines, but if there isnt a good way to do that ill just focus on what they did and try to copy that with C# in the most efficient way i can find.

Do you know of any references i might use with the current version of Visual Studio to make AutoCAD plugins? Becuase i am finding some good stuff on .net but its all like 10 years old and the difference in user interface is kind of tripping me up.

gile

  • Gator
  • Posts: 2507
  • Marseille, France
Re: Auto Lisp to C# Conversion
« Reply #3 on: May 06, 2016, 12:38:52 PM »
Hi,

Learning AutoCAD .NET programming is not at all the same as learning AutoLISP.
As Atook said, don't try to do anything with AutoCAD .NET API until you're familiar with .NET basics, Object Oriented Programming, Visual Studio and C#.
You can find many tutos and books about .NET and C# programming not related to AutoCAD.
Speaking English as a French Frog

ChrisCarlson

  • Guest
Re: Auto Lisp to C# Conversion
« Reply #4 on: May 06, 2016, 01:01:00 PM »
You'll have as good of luck converting orange juice to apple juice. Study C#, then .NET, lastly just maybe write something for AutoCAD.

nobody

  • Swamp Rat
  • Posts: 861
  • .net stuff
Re: Auto Lisp to C# Conversion
« Reply #5 on: May 06, 2016, 03:39:34 PM »
Agree with others...learning the language is more important... it's pretty universal. Once you know the language you can customize for many more applications, not just autocad.  That said...I started out by converting my collection of lisp routines over the last 16 years or so to .net routines.  Was a good learning experience...but ultimately, not sure it was really all that worth it.

I find the .net application much more useful for autodesk vertical applications.

JohnK

  • Administrator
  • Seagull
  • Posts: 10603
Re: Auto Lisp to C# Conversion
« Reply #6 on: May 06, 2016, 03:46:00 PM »
...
 That said...I started out by converting my collection of lisp routines over the last 16 years or so to .net routines.  Was a good learning experience...but ultimately, not sure it was really all that worth it.

...

I was told--once or twice--by a CS engineer to shut up until I've written 10,000 lines of code. ...so I'm sure your exercise put you closer/over to that mark (wasnt a waste at all).

TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Wwes

  • Guest
Re: Auto Lisp to C# Conversion
« Reply #7 on: May 09, 2016, 09:03:51 AM »
Thanks guys ill go bury my self in C# and Object oriented  programming tutorials and hopefully emerge with some more interesting questions.