Python Forum

Full Version: Can I make this program on Python?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey,

I'm learning Python, and i want to know if is possible to make a program, using Python, that interacts with other programs, like SolidEdge for example.

Just to give some context, I'm a Mechanical Engineer and in my company we take to much time doing some repetitive tasks. One of them is transforming 3d parts in 2d with DXF format.
This is time consuming because sometimes we have to do this process to 40/50/100 parts and we end up spending one day in this.

My question is, is it possible to do a program with Python that receives all 3d parts I want and then, the program open SolidEdge and do the process to transform the parts into DXF format one by one?

Is it hard for a beginner like me?

Thank you all,
From Portugal
What is the file extension of those 3D parts?
Yes, you can do it. SolidEdge has no native support for Python, it uses .NET. You can use IronPython in .NET to solve your task.
Maybe doing your task direct in C# is easier.

Here is one source: https://github.com/Rlee13/IronPythonExamplesForSE

One more question you should ask: Can you do the conversion outside of SolidEdge.
I don't know if I can do the conversion outside of SolidEdge. I know what the program should do, but i don't know the path i need to make, neither the easiest one.

I barely know how to program in Python, for now I don't want to try C#.
I'm trying to use this to learn how to program, but i'm afraid this is too much.

Any help where should I start? I'm only familiar with excel macros, where I recorded the task and then use it, sometimes I tweaked the code but nothing more than that.
I was thinking in using the same approach with SolidEdge. Programing a script to make the same steps for all parts.
Quote:One of them is transforming 3d parts in 2d with DXF format.

What is the source format of the files? Are there any special parameters which need to be applied before the conversation? I think this programs have things like origin, orientation, layers, etc.

Sometimes you can do also a conversion via command line. Do you have SolidEdgeTranslationServices.exe? Can you use this for your task?

If yes, the rest is very easy. Scanning a directory for files and execute a program is not rocket science.
It would be good to convert the files without using SolidEdge. It's not clear yet what are those 3D files.
You can automate this easy but it will be ugly and not so efficient. I am using PyAutoGUI for two of my own automation scripts.
there are number of python packages that work with dxf files. Some months ago (around Feb 2017) there was user working with dxf files and at that time I had a look at dxfgrabber package in order to help him. There are others packages too:
https://pypi.python.org/pypi?%3Aaction=search&term=dxf

What is the input format? dxf?
The 3d files are in ".part" format. Is the normal format for Solid Edge.
The thing with this is you can't just save the part with DXF format, as you do with word 2010 to PDF for example.
You need to do a list of steps in SolidEdge, such as converting to sheet metal (and for that you need to select faces and edges)

Quote:Do you have SolidEdgeTranslationServices.exe?
What is this?