Jump to content
Simio Forum


  • Content count

  • Joined

  • Last visited

Community Reputation

0 Neutral


    [url=http://remroom.ru]ремонт квартиры своими руками видео[/url]
  • ICQ
  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. SBrizi

    Using MySqlConnection within IDesign Context

    Hi everyone, i need to using MySqlConnection within the IDesignContext but i've got this error: [attachment=243:name] 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 /// <summary> /// 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. /// </summary> public string Name { get { return "ADD NODES EDGES"; } } /// <summary> /// Property returning a short description of what the add-in does. /// </summary> public string Description { get { return "Adds nodes and edges from a data base by MySql"; } } /// <summary> /// Property returning an icon to display for the add-in in the UI. /// </summary> public System.Drawing.Image Icon { get { return null; } } /// <summary> /// Method called when the add-in is run. /// </summary> 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 } }