Slingshot!

Slingshot! is an Open Source plug-in for connecting Grasshopper to relational databases

Slingshot! features collection of components for reading, writing, and managing relational database systems using SQL.

  • Mohamed Naeim

    What is it use for?
  • Nathan Miller

    Hello Mohamed,

    The MySQL plug-in allows you to access, query, and write data to MySQL database servers with Grasshopper.  SQL stands for "structured query language" and allows you to set up some rather sophisticated relationships between large sets of data.  

     

    I have been experimenting with using MySQL as a data store for shared parameters and other information that multiple instances of Grasshopper (or other software) can access and use.

     

    Video examples are coming soon.

  • Nate Holland

    I finally had time to watch the last two of your tutorials on Slingshot. I think the changes from 0.5 to 0.6 will make a big difference in being able to understand it right away. I really wish I had this when I was working on my Thesis project. I really think it will help on large definition files in allowing me to break them into multiple files.
  • Miguel Vidal

    Congratulations for your work again!
  • Arthur Mamou-Mani

    Hi Nathan,

    Thanks so much for your plugin!

    Hereafter is a conversation which mentions Slingshot:

    http://www.grasshopper3d.com/forum/topics/keep-last-galapagos-round...

    I hope you can help :)

    Many thanks,

    Arthur

  • Nathan Miller

    Minor update available:  Slingshot! GH+MySQL v0.7.2.1
  • Nathan Miller

    Slingshot! Database v0.8.0.0 has been released.  This is a major update with new features and workflow (and probably bugs!)  Read more here.

  • Pedro Arrobas da Silva

    hello,

    I'm trying to use slingshot's latest version with Postgres, and somehow when i try to connect it, it always returns the same message:

    {0}
    0. System.Data.Odbc.OdbcException: ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
    at System.Data.Odbc.OdbcConnection.HandleError(OdbcHandle hrHandle, RetCode retcode)
    at System.Data.Odbc.OdbcConnectionHandle..ctor(OdbcConnection connection, OdbcConnectionString constr, OdbcEnvironmentHandle environmentHandle)
    at System.Data.Odbc.OdbcConnectionOpen..ctor(OdbcConnection outerConnection, OdbcConnectionString connectionOptions)
    at System.Data.Odbc.OdbcConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)
    at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)
    at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
    at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
    at System.Data.Odbc.OdbcConnection.Open()
    at SlingshotDB.GHODBC_QUERY.SolveInstance(IGH_DataAccess DA)

    Does any1 know how to solve this problem?

    Tks a lot,

    Pedro.

  • Nathan Miller

    Pedro, You may to need to verify your Server IP and Port.  Are you accessing the Postgres server though localhost or is this for remote access?

  • Pedro Arrobas da Silva

    Apparently all settings seem to be fine. Server is running on localhost, default port. Databases already loaded and ODBC drivers updated. The only problem is accessing them via grasshopper. I've managed to establish connection to a mysql server, but no success with postgres.

  • Nathan Miller

    I will take another look at the ODBC driver tonight to see if I can replicate your error.  It seems to be working fine with my install of Postgres which makes me think that your DB configuration may be a little different.

  • Nathan Miller

    Pedro, I looked into your issue further and I am able to replicate the error if the connection string is incorrect.  Make sure you specify the database name you are connecting to.

    Additionally, some SQL queries supported in MySQL are not supported in Postgres or there may be slight differences in syntax... for example "SHOW databases;" is not supported in Postgres.

    -Nathan

  • Nathan Miller

    Something that may be of help to everyone:  http://www.connectionstrings.com

    While I have provided a few connection components, they may not be appropriate for all cases.  ConnectionStrings.com is a great resource for finding the correct means of connecting to a remote database.

    -Nathan

  • Nathan Miller

    Dear Slingshot! Database users,

    I have created a user survey in the hopes of improving the plug-in and determining new development possibilities.

    User Survey

    Please take a moment and fill it out!

    Best,

    Nathan

  • Nathan Miller

    Greetings,

    I have created a page for Slingshot! documentation and tutorials...  It is still a work-in-progress but hopefully it is information new users will find helpful.

    http://slingshot-dev.wikidot.com/tutorials

  • Nathan Miller

    The Slingshot! development wiki  (along with my other pages) have gone into blackout mode in protest of SOPA and PIPA.  Sorry for any inconvenience...  but this is important.  Learn what this is all about. 

  • Nathan Miller

    Site is back up...  here is the Twitter component engaged in some opposition...!

  • Toussaint Jimenez Rojas

    Nathan its posible to link any GIS to GH with Slingshot, the GIS its in Shape Format File  just Guess ?

  • Pedro Arrobas da Silva

    Hello Toussaint,

    I did it with a ODBC connection to a postgreSQL server. So yes, it is possible. You have to store the shape file into the database and then convert the geometry from WKB to text, so that grasshopper can draw the polygons.

  • Simon Moreau

    Hello

    I have found a syntax error in the SQL Code of the Create Point Database component. The closing brackets of the CREATE TABLE line seems to be missing (In red on the following picture).

  • Erick Katzenstein

    Nathan,  thanks for all your hard work.

    I'm having trouble with the Create Mesh Database component.  When I insert a mesh (basic mesh sphere), and put this into the command line, I get this error: 

    MySql.Data.MySqlClient.MySqlException (0x80004005): Column count doesn't match value count at row 1

    I checked the mySQL database and the table seems to log faces but there are not values for the vertices.  Any suggestions?

  • Nathan Miller

    Hello Erick,

    I just took a look and it might have to do with the INSERT statement for the vertices is expecting a 'color' value for that column... which is not being provided with the values.  I tested the component on my end before release so I will verify if this is, indeed, the problem.  

    Can I ask if you are using the most recent version or an older one?  I'll add this fix to my list for my next build.

    -Nathan

  • Erick Katzenstein

    Thanks for looking into this.  I'm using the most recent version of Slingshot and MySQL.

  • Nathan Miller

    Erick,

    Since you are just using MySQL, see if you get the same error with version 0.82 available on Food4Rhino. http://www.food4rhino.com/project/slingshot

    The SQL syntax for that component in that version seems to be correct.  

    I was trying out some vertex color in the new version and must have forgotten to circle back before releasing v0.88... sloppy work on my part.  I will correct in the next release.  For now, stick with v0.82 if you need that component.

    -Nate

  • Erick Katzenstein

    Great, thanks for your help.

    -Erick

  • Nathan Miller

    Hello Erick,

    I have corrected the syntax issue with the new build (0.882)...  see the new discussion above.  2 new components are also available for testing.

    -Nate

  • Nathan Miller

    That voice is like silk... and the content is even better!  ;)

  • Philipp

    is it possible to make a component to somehow send a Get command with custom query to any API

  • Erick Katzenstein

    When I query the face vertices from a mesh database, it shifts the face list.  For example, if I have a four vertex mesh, the databse will give me a face of T{1;2;3;4} when I really want T{0;1;2;3}.  I'm subtracting 1 from each value right now to get the desired result, but I just wanted to let you know in case there are issues with other users.

  • Erick Katzenstein

    I'm having trouble getting the "select" query to work.  When submitting the query in GH 9.0064, I get this error: 

    System.InvalidCastException: Conversion from type 'DBNull' to type 'String' is not valid.
    at Microsoft.VisualBasic.CompilerServices.Conversions.ToString(Object Value)
    at SlingshotDB.GHMYSQL_Query.SolveInstance(IGH_DataAccess DA)

    Is anyone able to replicate this issue?

  • Nate Holland

    Nate, I just upgraded to the build you posted about a week ago and don't see any components for creating tables or columns. Is it possible to create/store extra columns of data alongside meshes in a mesh database?