.net abstract class usage with IronPython

Ah Catia, have fun, its horrible.
Putting it in brackets means you are casting it. Its the opposite to Python syntax:

Python:
int(myFloat)
C#
(int)myFloat

My God, I support my previous statements, Csharp is terrible to work with, so illogical.

PS: How did you figure out it’s catia? :smiley:

I did C# programming in Catia as well! Its not C#, its the horrible COM Interface of Catia

I am working with their internal scripting language (EKL) and I have little to none problems. But this COM Api it is so messed up, nothing is where it is supposed to be. I cannot find a single method. I’m dir() and type() every single thing.

True!,

You really(!) need to carefully read the “V5Automation.chm”

You need
using INFITF;
using MECMOD;
using PARTITF;

I just referenced everything from the ComApi :slight_smile:

Visual Studio is making people lazy :smiley:

I tend not to use it because it’s an overkill for the small apps that I make. Too much loading time, logins gits assemblies classes, solutions.

I made WingIDE working well with IronPython, but I had to do my own imports that’s why I created the module. I’ll try to continue this way and create all python classes of .net abstracts in there.

I feel I jumped into the deep again :smiley:

Well, I find Catia Com with C# difficult, using IronPython would be some sort of Hardcore Difficulty.

Since I’m not so experienced coder, and I find everything difficult that doesn’t surprise me. Problem is that all examples I can get from their documentation is for VB and I hate this disgusting language.

No offense but it’s like German :smiley: Some things in it just makes absolutely no sense to me. :smiley:

You will need to read the sdk carefully to understand how each object is related to each other. The problem is also, what do you get back. Little stupid things, like indexing works from 1 to n and not 0 to n-1. It just returns nulls or nothing if its not working. Really difficult.

Yes, I am used to this because EKL is the same, all lists start from 1

If you not used to this concept, this gives you days of headaches.

Yep, been there done that. I created a rule to export stuff to excel then used CPython to manipulate it. I had so many issues until I figured out it is reading from 1. :rofl:

I also used to do lowlevel coding by using user32.dll. I had this module called ISD, which wasn’t callable through code. So I faked mouseinput, getting window location, reading pixel and automated clicking. Selecting through clicking at the graph and many of this very weird way in automating within catia

:smiley: When you do things like that you wonder why are the designers needed behind the PC :wink:

Actually it looked quite cool, but if you automate like this, you don’t really get a benefit in terms of efficiency.
Its so slow to create useful automation scripts in Catia, that a designer would have done the same “manually”. I just served them in a way, that they don’t need to that kind of work which people shouldn’t do unless they have murdering their own grandma.
But once you have done it, you feel like you know programming. Quite interesting projects.

… and you stop complaining about Rhino any other Api :smiley:

Yes, you’re right. I have to appologize about my Rhino Api complains since I got to taste the real nightmare. :blush:

I wonder what will happen if I try to connect to Rhino via COM :thinking:

1 Like

Well COM is always difficult. Its language independent and this advantage comes with big disadvantages. But if you have at least a good structured api/sdk, you can much easier solve problems.

By the way, this means you can also access Catia COM with plain CPython.

I can do that, but I wanted it to be IronPython :stuck_out_tongue:

I just like challenges I guess.

1 Like

:rofl::+1: