Jump to content

Welcome to the Simio Forum

Welcome to the Simio Forum! Experience the full experience of the forum by becoming a Simio Insider!

Click_Here_button.png

New Software Release

Our latest release, Simio 10.174, will be live in July 2018!

Save the Date!

Simio Sync is May 14-15, 2018! More details coming next month.

SBrizi

Members
  • Content count

    7
  • Joined

  • Last visited

Community Reputation

0 Neutral

About SBrizi

Converted

  • OCCUPATION
    [url=http://remroom.ru]ремонт квартиры своими руками видео[/url]
  • ICQ
    389103393
  • WEBSITE
  • LOCATION
    Russia
  1. Hi, I would be interested in making an animated symbol for a vehicle? It is possible and if so how? Greetings.
  2. It would be very convenient to be able to unlock edit on more items at once and not one by one.
  3. Hi everyone, I have a question: what happens in a vehicle if I set the task selection strategy on largest priority and also I define an evaluating transport request addon process?
  4. SBrizi

    Using MySqlConnection within IDesign Context

    Sorry, it was my mistake. I had copied the wrong dll file.
  5. Hi everyone, i need to using MySqlConnection within the IDesignContext but i've got this error: This is my code using System; using System.Data; using System.Data.Odbc; using MySql.Data.MySqlClient; using MySql.Data; using SimioAPI; using SimioAPI.Extensions; using System.Collections.Generic; using System.Text; namespace ADDNODESEDGES { public class UserAddIn : IDesignAddIn { #region IDesignAddIn Members /// /// Property returning the name of the add-in. This name may contain any characters and is used as the display name for the add-in in the UI. /// public string Name { get { return "ADD NODES EDGES"; } } /// /// Property returning a short description of what the add-in does. /// public string Description { get { return "Adds nodes and edges from a data base by MySql"; } } /// /// Property returning an icon to display for the add-in in the UI. /// public System.Drawing.Image Icon { get { return null; } } /// /// Method called when the add-in is run. /// public void Execute(IDesignContext context) { // Places some new objects from the Standard Library into the active model of the project with the information from the data base. if (context.ActiveModel != null) { //Connect to the data base MySqlDataReader rdr = null; string DB = "test"; string connStringSql = "server=localhost;user=root;database=" + DB + ";port=3306;password=theoracletinto;"; MySqlConnection sqlConn = new MySqlConnection(connStringSql); //Read edges from the data base using (sqlConn) { sqlConn.Open(); string stm = "SELECT * FROM NODES"; MySqlCommand cmd = new MySqlCommand(stm, sqlConn); rdr = cmd.ExecuteReader(); } // Place NODES objects into the active model. IIntelligentObjects intelligentObjects = context.ActiveModel.Facility.IntelligentObjects; while (rdr.Read()) { int i = 1; double X = rdr.GetDouble(6); double Z = rdr.GetDouble(7); INodeObject TNode = intelligentObjects.CreateObject("TransferNode", new FacilityLocation(X, 0, Z))as INodeObject; TNode.ObjectName = rdr.GetString(1); i++; } } } #endregion } }
×