Accessing Enovia's python interface from Excel / VBA? - python

We are using software called Enovia.
I would like to query Enovia from inside Excel / VBA.
After some search, Enovia seems to have a programming interface called Abaqus.
http://www.3ds.com/products-services/simulia/services/training-courses/course-descriptions/introduction-to-the-abaqus-scripting-interface/
I would like to access this interface in VBA directly but I didn't find anything to that effect.
I found two projects that might allow Excel/VBA to talk to python components or at least to python scripts.
They are as follows
Python For Excel
http://opentradingsystem.com/PythonForExcel/main.html
And the discontinued excelpython
github.com/ericremoreynolds/excelpython
which became integrated in xlwings
xlwings.org
I am not familiar with python nor these two projects. I'm not sure if they will allow me to do what I want.
I'm ok with learning some python to do this but my main program and user interface is in excel.
I figure I could make some simple python scripts then call them through the python interpreter from excel with shellexecute but that is not a very elegant solution I think.
Any advice welcomed
thanks !

Enovia uses the MQL language for scripting. There are some guides available, such as http://emdros.org/MQL-Programmers-Guide.pdf
I would recommend some training such as http://www.techniatranscat.com/services/education/mql-and-tcl-intro as this doesnt seem to be a very common language.
Not to be confused with the financial trading language MQL4/MQL5 from MetaQuotes Software Corp.

ENOVIA does not have a Python programming interface.
Abaqus is a FEA simulation software which can be scripted with its own Python programming interface.
ENOVIA though, is a PLM software solution. They are different software for completely different applications. As programming interfaces you may look at maybe this
In short, you may need to contact your Dassault Systemes local support team to point you in the right direction.

Using tcl and mql you can solve the problem
TCL |
MQL

Latest Enovia version 3DEXPERIENCE support Rest based webservices. you can create a rest API in enovia and can call rest service using vb script in excel.
3DEXPERIENCE Enovia Rest webservice Framework

Above mentioned Rest framework may not be available with 2014X version. You have to try SOAP based service or JAX-RS.
Option 1
Enovia is java based application and doesn't support VBA ADK to directly work with backend data. However webservice can be used communicate between applications of different platforms or managed by different programming ADK.
For this you need to create your own service (REST/SOAP). For this you will need server access and first you have to write some java code (Rest/SOAP service) and update the class/jar into 2014 server (tomcat).
Then you can make use of that service in to your vba function.
Again you have to decide the kind of data whether xml or json it is separate topic.
Option 2
As I told earlier Enovia is Java based application, It provides JAVA ADK to extend its functionality.
Sample code shows how you can get the context and work with Enovia ADK.
matrix.db.Context ctx = new matrix.db.Context("http://myserver-nocas:8080/enovia");
ctx.setUser("Test Everything");
ctx.setPassword("");
ctx.connect();
System.out.println("Is context set "+ctx.isConnected());
As you mentioned you are currently using 3DEXPERIENCE then 3DPassport might block above URL method connection, So you need to pass NO-CAS URL.
You can get the context by running above java code from your local eclipse. Using this ADK you can also call MQL queries and work seamlessly.
import com.matrixone.apps.domain.util.MqlUtil;
String strPartFamily = MqlUtil.mqlCommand(ctx,"temp query bus Part * * select attribute[Length]");
But again this is java based solution and not VBA.
Finally 3DEXPERIENCE provides MQL console in server, to play around with all the data using SQL like queries in more developer friendly manner. Enovia also provides web based MQL console but you need to have some license for that (Administrator should be having access).

Use TCL to go through Excel sheet, it is very easy. Use "/t" to separate data.

Related

newbie: writing backend code for website

I am usually working in fields of machine learning and hence my background is mostly in stats/ML and no formal web background.
Usually for my project, I work on python which is connected to my local mysql db... to fetch data adn everything.
Now, my work is mostly complete.. everything is console based..
(like traditional programs).
How do I integrate it on the front end. I understand that this is more like a server side scripting.
So, lets take an example of google.
In the front end.. someone enters a search query.. and in the backend lets say there is a program in C++ which executes that query.
How did this interaction takes place.. if front end is written in lets say php..
I assume shell execution of program is a bad bad way to run programs.. ??
Any suggestion will be greatly appreciated.
Thanks
As suggested by Ignacio, you will first need to design API for your project. This is basically clearly laying out what (and how) queries will be supported for your project.
You don't need shell execution and neither need to learn PHP. Since your project is in Python, you can use Python Web-frameworks like Django, Web2Py.
The first thing to do is to develop an API for your library. From there you can develop multiple frontends that use the same API in order to present it multiple ways.
Decouple your user interface logic from your business logic, then reuse the business logic libraries in an application that accepts input over HTTP instead of the console. Django is a popular web framework that will take care of a lot of the front end concerns for you, or you can use something like CGI if you prefer to be a bit closer to the bare metal. The Python Wiki has a section on web programming that you might find useful.

web based visual programming interface based on python for data visualization

I just discovered impure.com and was very impressed by what can be achieved in terms of visualizing data using their workspace. Although the platform is free to use, but not open source yet. This causes a few problems because the API section works with .com sites for eg. for ebay, so I cannot visualize ebay listings for regional sites such as ebay.in because the link to ebay.com is hardcoded.
I searched around, but didn't find other projects that offer a similar way to work with site APIs and other data sources with the kind of user interface and detail that impure.com does in a realtime way within a browser window.
This brings me to the questions:
What technologies would be involved in creating a similar kind of project
What are the open source tools that can help develop a fullscreen UI to render the workspace. Are there any alternatives to flash for this, and how do they compare
The goal would be to use standard python data structures, python scripts to do some processing on these data structures, scripts to gather data from csv, json and API sources such as google yahoo, wikipedia and flickr, and scripts to render graphs, tag clouds, network visualizations etc. Then bring them all together into a visual interface that supports drag drop and simple type checking
How would the python backend integrate with the UI
sorry for the rambling question, but i wanted to present as much detail as possible. I'd like to do this for the fun of it
So, restating, Impure is like OpenDX but running in a browser and you are interested in suggestions for an architecture to build your own web version of it?
I suggest using Cappuccino as your front end Web GUI. This is a toolkit for building RIAs in the browser that are completely based on HTML and Javascript (no Flash). It is modeled after Apple's Cocoa so you can build some very sophisticated apps with it.
On the web server side, I would use the Python bindings to OpenDX to build a JSON API that is exposed to the web browser. Note, this Python module uses DXLink, which appears to be mainly a batch/command interface to OpenDX - you might still need to do some work to get visualizations out of it and back to the web browser. But, it's all open source so it should be feasible. Here's a discussion where others are attempting the same thing.
I don't know for sure that OpenDX supports pulling data via web service calls but you could certainly handle that on the Python side and feed it into OpenDX.
Note, I don't mention a Python web framework because, since your app will be mostly a JSON API almost any of them would work just as well. I suggest the thinnest and simplest one that appeals to you.

Should I use Python for a small CRM ? If not, then is there any other platform?

We have a new client who would like us to develop a custom CRM for their employees.
The main features they would like are:
Ability to save forms
Send reminders to employees by email and text messages
Basic charting capabilities
Automatic backup online
So as we see, saving data, and then reminding the employees are the most important functions of this CRM.
Now my main question is -- I've been meaning to learn Python since a while. I think this CRM should be doable by a person who is learning Python. I have good experience in PHP, jQuery and a little bit of .NET
So does anyone here think that I should go ahead with Python as a platform for this project ? Or should I go for any other platform, which might have features that Python won't provide me ?
I wouldn't re-invent the wheel, if I were you. Instead I will aim to leverage one of the existing open source CRMs to build the system. A well known open source CRM is SugarCRM. There are more available, most of them built with PHP, so your PHP experience will be useful.

writing python script on windows

I am new to python scripts .
I have few repetative testing tasks such logging to various IM's
ex (OCS,different public messengers) etc .
Is it possible to automate these tasks using python .
If so from where do I start with ?
Working on windows 2003 server .
I know the basics of python. want to enhance the skills .
Thanks,
Tazim
Not quite a duplicate question, but the answers to "How can we use ms office communicator client exposed APIs in python, is that possible ?" should prove valuable.
If you are new to Python, you'll want to check out the Python Tutorial.
You may also wish to consider something a bit more Windows-oriented like VBScript or PowerShell, however.
OCS
For OCS, you should be able to use COM scripting to do most but not all[1] things. The code should look a bit like this:
import win32com.client
def get_contact(signin_uri, communicator):
c = communicator.GetContact(signin_uri, communicator.MyServiceId)
return c
comm = win32com.client.Dispatch('Communicator.UIAutomation')
contact = get_contact("jaya#contoso.com", comm)
You should be able to translate the documentation from the API fairly easily, especially if you focus on the JScript examples.
MSN/Live, AIM, ICQ, and IRC
For MSN/Live Messenger, the excellent twisted library contains an rudimentary implementation of a multiprotocol IM client (and server). To get started, check out some code samples.
[1] From the documentation:
For reasons of security, not all
methods or properties can be called
using JavaScript or another scripting
language. Such restrictions are
documented in Office Communicator Automation API Reference.

Google Web Toolkit like application in Django

I'm trying to develop an application that would be perfect for GWT, however I am using this app as a learning example for Django. Is there some precedence for this type of application in Django?
Pyjamas is sort of like GWT which is written with Python. From there you can make it work with your django code.
Lots of people have done this by writing their UI in GWT and having it issue ajax calls back to their python backend. There are basically two ways to go about it. First, you can simply use JSON to communicate between the frontend and the backend. That's the approach you will find here (http://palantar.blogspot.com/2006/06/agad-tutorial-ish-sort-of-post.html). Second, some people want to use GWT's RPC system to talk to python backends. This is a little more involved, but some people have created tools (for example, http://code.google.com/p/python-gwt-rpc/).
To be honest, most successful projects just use JSON to communicate between GWT and the python server. GWT's RPC is pretty advanced in that it is able to serialize arbitrary java object graphs to and from the client. It's a tricky problem to get right and I'm pretty doubtful that any of the python tools have it right.

Categories