For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings

 

Need to speed up your development?
Have a look at our:

Samples & Tools

 

Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

Dot Net

Euan's picture
Forums: 

Hello, have people had much luck using Dot Net with Cascade? I seemed to use the plot early on. I'm confused about how to call C++ from C#. What I'd really like is an example that creates some geometry, then maybe saves it to a step file. Even better if it could load the geometry into OpenGL (I already have my own GL framework (Tao)). Any help would be greatly appriciated, Thanks

Jonathan Hill's picture

Hi,

I have a set of C# wrapper class (but not using P/Invoke) which would allow to load in IGES or STEP file in .NET using VS 2005.

Jonathan

Philippe Pigeard's picture

Hi Jonathan,

Can you tell me more about your IGES & STEP code in .NET / VS 2005.
Awaiting your feedback.

Philippe

Philippe Pigeard's picture

Hi Jonathan,

Can you tell me more about your IGES & STEP code in .NET / VS 2005.
Awaiting your feedback.

Philippe

Jonathan Hill's picture

Hi Philippe,

Nice to hear from you.

Currently I have (.NET) assembly library which wrapps some of the basic OpenCASCADE v5.2 classes like the example which comes with the source.

It allows you to create the view, add shapes, load IGES and STEP files, rotate, pan, zoom etc. pick sufraces, faces, and vertex from the model.

I'm adding more and more functionally as I go along, is this something that would useful to you?

Jonathan

St. Grigoleit's picture

Hi Jonathan,

it is possible to have a look on this interessting classes?

Steven

Jonathan Hill's picture

Hi Steven,

Sure, Currently I have only implemented the classes and functions that I've needed so far, and I'm adding more and more as I go along.

Would it help if I sent you what I've done so far and include a demo project with it?

Jonathan

Gabriel Mongeon's picture

Hi Jonathan,

I'd like to see what you have done

Thanks

Jonathan Hill's picture

Hi,

You can download an example Visual Studio 2005 (.NET Framework v2.0) project I have created from: -
http://www.myxyz.co.uk/Downloads/Development/

(the path is case sensitive and it contains about 20Mb of files)

Its a simple Windows form hosting a OpenCASCADE window with a rotating sphere created on a thread.
(The debug folder also contains all the runtime .dll files, including the OpenCASCADE v5.2 runtime files)

I am currently working on support for the new OpenCASCADE v6.1 release.

Let me know if you have any comments or queries.

Jonathan

Hesham Nasif's picture

Jhonathan
Thanks alot for that offer, i down loaded but i have run time error running the application, Is it need 2005 for opening the project.

Jonathan Hill's picture

Hi Nasif,

Yes, it is a Visual Studio .NET 2005 solution.
Could you give me more information on the run time error you are seeing?

Thanks
Jonathan

Hesham Nasif's picture

Hi Jonathan
I already use the library you offer it and it works very well, but how can you connect the shape with the document to be able to handle one shape with different material and different colors

Jonathan Hill's picture

Hi,

You looking to do something similar as the ‘User_Cylinder’ Interactive Object included as part of the OOC samples? I’ll see if I can get something working for you.

Jonathan

Gerald Andersen's picture

Jonathan,

Just saw this thread. I'm new to Open CASCADE, and know almost nothing about wrappers. Am using C# (VS 2005)and am having trouble getting to the vertex display attributes (point and lineAspect) through OpenCASCADE52.Visualization.TKV3d.Prs3d.Interfaces.IDrawer. I see the enumurations for these properties are in OpenCASCADEXLib, and I get type conversion errors, which makes enough sense to me - I just don't konw how to to do it preperly. I'd like access to the vertex atributes. Oh, I started by succesfully building the makeBottle project found at http://www.myxyz.co.uk/Downloads/Development/

Jonathan Hill's picture

Hi Gerald,

I'll take at look at that for you and let you know.

Jonathan

QbProg's picture

mmm just thinking... couldn't the C++ wrappers been generated from the CDL files?
I think that only the Handle and the memory management class would require a rewrite (or not?)

Good bye

Gerhard Hofmann's picture

Hello Thomas,
I generated C# wrapper from CDL files. To be platform independant I use PInvoke. Some of it is discussed here:
http://www.opencascade.org/org/forum/thread_8927/
You can also download a trial version of CADability from http://www.sofa.de which includes this wrapper machanism. You only need these two dlls: "OpenCascade.dll", which is a C# class library that you can browse and "OCasToCSharp.dll" which is a plain C++ dll that is accessed from opaencascade.dll.
There is only a subset of the CDL files converted, just those parts we need ourselves, but since conversion is done automatically, we could wrap any classes.
I would be glad to get some feedback.
Gerhard

QbProg's picture

I'll try soon that solution, thanks!

Joseph's picture

sheezus thid is hell, i have VS 2k3 and porting even that sample project has been a pain in my rear to say the least. Anyone else using VS.NET 2k3?

Gerhard Hofmann's picture

Hi Joseph,
which approach did you take?
I did it with VS.NET 2003, but I am now using VS.NET 2005
Gerhard

Guido van Hilst not specified's picture

For developing opencascade with c#/.net have a look at: https://www.occwrapper.com/

Victor Reznov's picture

wrap bythe CLR.    

there  simples in occ/doc  

occproxy

my directory

D:\OpenCASCADE7.0.0-vc14-64\opencascade-7.0.0\samples\CSharpmy

Data transmission is a bit tricky. 

Contact us

Attention: DO NOT use this form for all kind of request for the removal of your personal data. Please follow this link for such cases.