Author Topic: Request MySQL database integrated  (Read 2037 times)

0 Members and 1 Guest are viewing this topic.

cadplayer

  • Bull Frog
  • Posts: 390
  • Autocad Civil3d, OpenDCL.Runtime, LISP, .NET (C#)
Request MySQL database integrated
« on: September 20, 2014, 01:52:28 PM »
Hello!
My idea to save all my AutoLISP function in a MySQL database. I think it could be very useful if I have more control of all functions collect in a database.

First thing I wondering, if itīs possible to connect MySQL server via .C# and recall Autolisp functions within ?
- I know that I can run a AutolispCommand ex.:
Document doc = AcAp.DocumentManager.MdiActiveDocument;
            doc.SendStringToExecute("(setvar \"CMDECHO\" 0)\n", true, false, true);
Have you think about to use Autolisp within a .NET methode?

Sec. could database have a intelligence to sort by function type, or if I looking after keys maybe: find all string-functions, list-function, lambda-methods ...

Hopefully itīs not much confused I wrote, I beginning build a db from skretch. Can somebody help me.

MickD

  • King Gator
  • Posts: 3619
  • (x-in)->[process]->(y-out) ... simples!
Re: Request MySQL database integrated
« Reply #1 on: September 20, 2014, 06:59:42 PM »
It sounds to me that you would like to automate calling your lisps to run 'routines'. Why not just do this in lisp? If you are using .net for performance then calling lisps from within won't be much help.

If you only need your lisp for some parts of your routine but you want to use .net to build routines I would consider re-writing those lisp methods in .net just to clean things up and perhaps improve performance.

As far as a db goes, MySql would be overkill, I'd look into NoSql or SqlLite which do not require a fully fledged server. Yes, a database will help with sorting function names, I'm not sure if you can load a lisp from a db though, never tried.

Another option to help organise your lisp functions and avoid all the complexity of a db could be to use some kind of name spacing convention to group and name your lisp functions.
Whatever you decide try not make things too hard for yourself and keep it simple :)
"Short cuts make long delays,' argued Pippin.”
J.R.R. Tolkien

nekitip

  • Guest
Re: Request MySQL database integrated
« Reply #2 on: September 21, 2014, 10:11:21 AM »
With .NET you can call sql server, and receive binary or text field.
However, MySQL is usefull only if you have a large number of customers and want to organise lisps on one central place. (dont know if you can start listp in autocad from string, never tried).
But, MySQL doesn't have LGPL .NET connector, meaninig - you cannot sell your app.
If your intent was to do it for yourself, per machine, or per few users, you can use, as sugested, using SQLite.
There is also MS SQL server, available for free in several flavors... so...

cadplayer

  • Bull Frog
  • Posts: 390
  • Autocad Civil3d, OpenDCL.Runtime, LISP, .NET (C#)
Re: Request MySQL database integrated
« Reply #3 on: September 21, 2014, 12:08:04 PM »
thanks for your replay, what nekitip says comes in my direction. Iīm your opinion MickID, itīs more cleaner to do all in one. Sometimes, sorry I have only little praxis with .NET, I can write some LISP codes very fast. But I have to say, my library of lispfunctions is increased i a couple of years. But .NET I have done only windwows-applications in last year where I started.
So maybe I want go two ways:
F * build all methodes in LISP new in .NET (longer way, needs time :-P)
S * combine .NET with LISPfunctions (but this is pretty bad)

If I think to my colleagues on my company, that use my LISP function. I have done two things to avoid copyright my tools. In my dropbox I have saved serialkeys for every user, these keys reads in running mode. Also I have saved some important files (like diverse arx,vlx,dcl,odcl,dll files) dropbox/folder. These would be download in using procedure. So it sounds very complex, is it too.
I know with C# can I read strings from a MySQL database, but could I run them as LispMethodes in Acad ? And another question is, I expect that all users have to install MySQL-InstallerServer or ?
Is it maybe I saved the hole LISPapplication on CompanyServer and collect all user over MySQL serials ?

nekitip

  • Guest
Re: Request MySQL database integrated
« Reply #4 on: September 21, 2014, 02:41:37 PM »
If you know lisp, and have lisp things, and don't have the time for .net, then just do it in lisp. However, think about this in the long run...
As for MySQL, again - i'm not sure what is your experience with database: you have database server, one only, available to all. There you keep your lisp routines, and others connect and download. To do this in .NET there are, again, various ways to do it, one of wich is by having ".NET connector" downloaded from MySQL site, and included in your app. Users will also have to have it, and you can include MySQL connector instalation in your app. However, as I have said it - MySQL connector is GPL code.
Again, if you not sure about MySQL, and all you need is a simple SQL operations, you can download and start some variant of MS SQL server. There was a "compact" or something like that before... check it.


cadplayer

  • Bull Frog
  • Posts: 390
  • Autocad Civil3d, OpenDCL.Runtime, LISP, .NET (C#)
Re: Request MySQL database integrated
« Reply #5 on: September 22, 2014, 03:06:50 AM »
Thanx nekitip, first I have to read/learn more about .NET and SQL otherwise I ask more questions which sounds confusing. In the moment I learn .NET with C# and caption now is databases with MySQL. I heard database on serverconnection - fantastic, so I could do what I wrote but I must have patience with myself.
Yes I am a LISPwriter but would be more a .NETdeveloper in the future - so perhaps you understand me now.