Hi,
Does anyone know how to connect to MySQL database and insert data from a set of blocks containing attributes?
Something like:
block 1:
- x coordinate;
- y coordinate;
- handle;
block 2:
- x coordinate;
- y coordinate;
- handle;
block 3:
- x coordinate;
- y coordinate;
- handle;
I've just got the second part (retrieving info from the blocks), but when it comes to connect to the DB I'm completely lost.
For the DB I'm using XAMP for Windows, thus using localhost, user ('user123'), pass ('pass123') and table ('table123'). The table has ID (PriKey and AutoInc), px, py and hdl fields.
Thanks in advance.
See connection strings here:
http://connectionstrings.com/mysql
That's what I've been doing... 😞
However, in order to make it more automated, I'd like acad to insert the data himself into de DB... 😉
As you have neither posted any autocad code, not sql cod, I have no idea where you really are.
It may be possible to link to Xampp as can be done with Excel, etc,
and if that is posted here the try theswamp.org, or google.
The most probable 'automatic' means is still:
autolisp makes a file,
then activates a dos or windows script,
which loads it into Xampp.
In one of my previous posts "Exporting multilayer objects"
where Lee_Mac provided the solution, that's exactly what I've been doing: it exports several elements into a txt file and later on a PHP program retrieves the info from it and inserts it into a MySQL DB. That was realy good for the job I was doing at the time.
However, for the one I'm working on, I need pretty much the same but instead of putting the info into a txt file, I need AutoCAD to insert it directly into the DB, since I no longer need the PHP file to perform whatever it was doing at the time.
If it is the connection side of the process, try that forum:
/discussion.autodesk.com/forum.jspa?forumID=16>
or something 'connectivity.'
Also, a 'Seach in this forum finds links.
Then you must have seen the post by, and of, Jon Fleming, like:
His site, and free AdoLisp, are still available.
Can't find what you're looking for? Ask the community or share your knowledge.