Get name or SMILES from Chemical Structure

User 430a6f7654

05-07-2011 07:08:47

Hi,


I am a C# developer in .NET. My requirement is to incorporate functionality where in a user can draw a chemical structure and fetch its SMILES or name at some button click event.


Please let me know if this possible or not. If yes then can anyone please let me know what are the procedures to accomplish this.


 


Thanks


Pranav


 


 

User 430a6f7654

06-07-2011 10:01:52

Hi,


I am getting the following error. Please let me know if this is paid license or free.


No license file found.
Product name: Structure to Name Plugin
License path:
Please contact [email protected] to obtain the corresponding license.
Students and academic researchers are entitled of free use
through our Academic Package, for more information
please visit: http://www.chemaxon.com/acpack_conditions.html

ChemAxon bd13b5bd77

06-07-2011 10:06:55

Daniel,


 could you please step in?


 


Thanks, Viktor

ChemAxon e7b9408ca1

06-07-2011 11:20:36

Structure to Name is a paid license.

User 430a6f7654

06-07-2011 11:31:33

Ok. Thanks for your reply

ChemAxon bd13b5bd77

07-07-2011 11:34:31

you can inherit from this class to freely customize it on your taste:


ChemAxon.NET.Windows.Forms.MarvinEditorControl.MarvinSketchForm();


e.g. if you use 1 instance for more than one session you should flag if it is already/still open,


this can be done pretty easily if you listen some events in the derived. E.g. OnClosing, OnClosed, OnActivated,


protected override OnClosed ... whatever.


I think this is a simple WIndows Forms programing and out of ChemAxon scope. If you think this is a limitation what ChemAxon code caused please let us know and specify it more with a prototype.


 


Thanks,


Viktor

User 3af65074b3

13-07-2011 18:49:49

do we have a pipeline plugin for converting names to structure/smiles

User 430a6f7654

14-07-2011 05:05:28

Hi,


Can any one please let me know how to make the original form inactive from where I open the MarvinSketch form as Dialog. Following is my code :


public string sketchStructure()
    {


string smiles = "";
        ChemAxon.NET.Base.View.IMoleculeEditorView editor = new ChemAxon.NET.Windows.Forms.MarvinEditorControl.MarvinSketchForm();
        editor.Title = "Draw your structure";


        ((ChemAxon.NET.Windows.Forms.MarvinEditorControl.MarvinSketchForm)(editor)).Activate();
        ((ChemAxon.NET.Windows.Forms.MarvinEditorControl.MarvinSketchForm)(editor)).TopMost = true;
        ((ChemAxon.NET.Windows.Forms.MarvinEditorControl.MarvinSketchForm)(editor)).BringToFront();
        ((ChemAxon.NET.Windows.Forms.MarvinEditorControl.MarvinSketchForm)(editor)).MinimizeBox = false;
        ((ChemAxon.NET.Windows.Forms.MarvinEditorControl.MarvinSketchForm)(editor)).MaximizeBox = false;
       
       
        if (editor.ShowAsDialog())
        {
            var converter = new ChemAxon.NET.IKVM.Chemistry.MolConverter();
            smiles = converter.ConvertToStringFormat(editor.MoleculeString, editor.MoleculeFormat, "SMILES");
        }
                return smiles;


}


The above method I am calling at a button click on a form(frmMarvinSketch). When the MarvinSketchForm opens, I want to make the original form inactive. Please help.

ChemAxon eb65a25631

18-07-2011 12:11:25

Hello,


 


try using:



 



 



 


this.SendToBack();


in the buttons event handler.


Regards,


A.



 

User 430a6f7654

19-07-2011 04:55:44

I do not get any method by the name SendToBack(). I am coding in C# , asp.net

ChemAxon bd13b5bd77

19-07-2011 07:25:31

Hi Pranav,


 


Andras thought of this I think:


((ChemAxon.NET.Windows.Forms.MarvinEditorControl.MarvinSketchForm)(editor)).SendToBack();


By the way you in vain you call these methods:


         ((ChemAxon.NET.Windows.Forms.MarvinEditorControl.MarvinSketchForm)(editor)).Activate();
         ((ChemAxon.NET.Windows.Forms.MarvinEditorControl.MarvinSketchForm)(editor)).TopMost = true;
         ((ChemAxon.NET.Windows.Forms.MarvinEditorControl.MarvinSketchForm)(editor)).BringToFront();


because the form has not been created physically at that point when you call them.


But as I suggested why do not you create an own form inheriting from the ChemAxon.NET.Windows.Forms.MarvinEditorControl.MarvinSketchForm? This is what I refered to in my previous post.


 class XX : ChemAxon.NET.Windows.Forms.MarvinEditorControl.MarvinSketchForm {
      XX() {
      }
   }


 And in this way Andras's suggestion works: this.SendToBack().
And in this way you can set properties from gui as well.


 


V.


 


 


 

User 430a6f7654

20-07-2011 06:38:49

Hi,


I have used the code in asp.net website project. The code runs fine when I run from Visual Studio. But when I run it from IIS, it gives the following error:


System.InvalidOperationException: Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application. at System.Windows.Forms.Form.ShowDialog(IWin32Window owner) at System.Windows.Forms.Form.ShowDialog() at FrmSearchHome.sketchStructure() at FrmSearchHome.ddlSearchCriteria_SelectedIndexChanged(Object sender, EventArgs e) at System.Web.UI.WebControls.ListControl.OnSelectedIndexChanged(EventArgs e) at System.Web.UI.WebControls.DropDownList.RaisePostDataChangedEvent() at System.Web.UI.WebControls.DropDownList.System.Web.UI.IPostBackDataHandler.RaisePostDataChangedEvent() at System.Web.UI.Page.RaiseChangedEvents() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint


 


Please let me know how to remove the error.



Thanks



 

ChemAxon bd13b5bd77

20-07-2011 07:37:35

Hi Calin,


 


coud you please advise the user?


 


Viktor

ChemAxon 6e93227fcc

20-07-2011 08:15:43

Hi Pranav,


From what I've read so far I think you are on a totally wrong direction here.


If you want to create a website (or page) where your clients should be able to edit structures you should use our Marvin MSketch Applet based editor not our .NET Windows Forms based editor.


Normally IIS is an application which listens for HTTP requests on port 80 and it forwards such requests to ASP.NET Handlers. A client (web browser) will make a HTTP web request to IIS server, the IIS server will forward the request to ASP.NET, ASP.NET will formulate a response which will be sent back to client (browser). After the response is sent back to client usually the connection between client(browser) and server(IIS) is closed.


At this point the client (browser) should have a HTML content which is capable to interpret and render correponding.


Because of the way how web based application work out, you can't create directly (from an ASP.NET page) any .NET Windows Forms controls on client (browser). 


 


Now back to your project what you should do is to put in your ASPX page our Marvin MSketch applet. You can start with some basic examples from http://www.chemaxon.com/marvin/examples/applets/sketch/index.html


Calin.

User 430a6f7654

20-07-2011 12:11:46

Thank for your response.


I have checked the Marvin MSketch Applet. Please confirm if it is a licensed version or we can use it freely.


 

ChemAxon bd13b5bd77

21-07-2011 13:38:29

Akos,


is Applet licensed together with Marvin?


Viktor

ChemAxon 990acf0dec

21-07-2011 18:20:12

Hi Panrav,


If you deploy MarvinSketch on a server as applet, you need a Marvin server-side license.


Best regards,


Akos