Open CASCADE, the 3D modelling kernel
3D modeling & numerical simulation

Search the Forums
See All Topics
 

New Dot NET v2.0 (Bottle Tutorial) assembly libraries for OpenCASCADE v6.2

New Dot NET v2.0 (Bottle Tutorial) assembly libraries for OpenCASCADE v6.2
Jonathan Hill 2007/06/24 23:15
Updated .NET assembly for OpenCASCADE v6.2 including example code for the Bottle Tutorial.

Download from:-

http://www.myxyz.co.uk/Downloads/Development/MakeBottle.zip

Just unzip the files and run the RegAll.bat file to register the OpenCASCADE COM module.

The OpenCASCADE COM module could also be used in other RAD type Development Environments, i.e. Visual Basic.

Jonathan
Gerhard Hofmann 2007/06/25 11:10
Hello Jonathan,

since we both offer our ".NET wrappers" here, I would like to get in contact with you. I am curious about the technologies you use, the motivation, the projects you are working on with OpenCascade, your experience with OpenCascade, etc. Just fel free to mail me at g-hof-mann[at]so-fa.de (omit the "-" characters).

best regards
Gerhard
Hesham Nasif 2008/08/04 01:43
Dear Gerhard
First of all i would like to express my thanks to you at early time help. I almost finish one application using OCC, it is not commericial but rather it is help for creating some geometrical model for other code. I wanted to ask you a question, and i am willing your answer as usual. How can i put my code into other machine does not have OCC on it
Best. My E-mail address has been changed to that one
Hesham
zhangbing 2007/06/27 09:22
Cool! Thank you!!!
zhangbing 2007/06/27 16:27
Hi, Jonathan
I convert the C# code to VB(VS2005), but there is an error about the function "MakeCompound" when debuging, it says that "Method not found: 'Void OpenCASCADEXLib.IBRep_Builder.MakeCompound(OpenCASCADEXLib.TopoDS_Compound ByRef)'.", what can I do?

Thank you!
Jonathan Hill 2007/06/27 16:43
Hi zhangbin,

Would it be possible for you to send me the VB code or project, just to save myself converting the code again and I'll let you know what I find.


Best Regards
Jonathan
zhangbing 2007/06/28 07:17
How can I get your EMAIL?

zhangbing 2007/06/29 12:13
Hello, Jonathan
Please give me your EMail,I can send the code to you. Thank you!
Jonathan Hill 2007/06/29 12:19
Hi zhangbing

Jonathan<dot>Hill<at>jonpc<dot>demon<dot>co<dot>uk

Jonathan
Jonathan Hill 2007/06/30 17:26
Hi zhangbing,

I'm trying to send an attachment to your e-mail address, but it just fails to deliver.

Jonathan
zhangbing 2007/07/01 02:44
Hi Jonathan,

I've received your e-mail, I try to debug again, it works perfect!

Thanks for your help!

Best regards
Axel Stenkamp 2007/07/04 10:47
Hello,

first thank you for publishing the MakeBottle example.

I am new to OpenCascade coding and found your wrapper to my favourite language C#.
Now i tried to read and show a step file using your sourcecode.

Here is my approach:

OpenCASCADE52.ModelingData.TKBRep.TopoDS.Interfaces.IShape topoDS_shape;

OpenCASCADE.ModelingData.TKBRep.TopTools.HSequenceOfShape sequenceofShape = new OpenCASCADE.ModelingData.TKBRep.TopTools.HSequenceOfShape();

if (OpenCASCADE.IO.ImportExport.ReadSTEP(openFileDialog.FileName, sequenceofShape) == OpenCASCADE52.DataExchange.TKXSBase.IFSelect.Interfaces.ReturnStatus.IFSelect_RetDone)
{
for (int index = 0; index < sequenceofShape.Length; index++)
{
topoDS_shape = sequenceofShape.Indexer(index);
OpenCASCADE.Visualization.TKV3d.AIS.Shape AIS_shape = new OpenCASCADE.Visualization.TKV3d.AIS.Shape(topoDS_shape);


Effect:
Reading the step file works fine... but accessing the sequenceofShape via the Indexer causes an AccessViolationError.

Question:
How do i access sequenceofShape to get topoDS_Shape, which i again need to convert to OpenCASCADE.Visualization.TKV3d.AIS.Shape for the viewer?
TopTools_HSequenceOfShape Class Reference does not seem to be equal to your wrapper code.

Thanks for your help.
Axel
Jonathan Hill 2007/07/04 11:25
Hi Axel,

I've just had a quick look at the code. It looks like the problem is that OpenCASCADE uses 1-based and not zero-based indexing in the sequence type (I've hit this a few times now :-( when working with the OpenCASCADE libraries).

I've include the fix code below:-

/* for (int index = 0; index < sequenceofShape.Length; index++) */
for (int index = 1; index <= sequenceofShape.Length; index++)

You can check this by looking at the C++ CImportExport class under the OpenCASCADE samples folder.

All the rest of the code looks fine to me, all you need to add is the "Display" command (and maybe FitAll) and then your model should be shown in the view.
I also import .STEP & .IGES files and if you need any help, then just let me know and good luck.

If you do come across a problem or the fix doesn't fix your issue I can create a demo STEP reader solution and see if that works for you.

Best Regards
Jonathan
Axel Stenkamp 2007/07/04 11:37
Hello Jonathan,

and it worked perfectly using the new index start.

Thank you for the immediate help.
Best Regards,
Axel
Ernest Abbott 2008/02/15 09:18
Hi Jonathan,

Looking back at the code originally given I tried it out, but got a compilation error on

if (OpenCASCADE.IO.ImportExport.ReadSTEP(openFileDialog.FileName, sequenceofShape) == OpenCASCADE52.DataExchange.TKXSBase.IFSelect.Interfaces.ReturnStatus.IFSelect_RetDone)

The problem is with OpenCASCADE.IO. ... it doesn't seem to exist. I've look at a lot of classes and can't find It. I'm using OCC6.2 and C# Express.

I'm am still trying to find my way around OCC (without any training or support documentation). I'm trying a proof of concept system and need to do 3 main things:-1

1. Read a Step file and display its contents
2. Select and object from the displayed file
3. Read a list of supplied vertices to create an object.

I can do 3. in OpenGL and 1 & 2, using an IFC file in OpenGl. But finding my way around OCC is proving very slow. I'm working in a research department of Singapore University and my time is running out.

I'm not asking for code as such but the general outline or example of how to do the above.

Juri Saragazki 2007/07/06 12:27
Hi Jonathan,

is it possible to compute a BoundingBox over an AIS_Shape? How can i do that?

my old Code was like this:

if (!entireBody.IsNull())
     {
          AIS_Shape entireAIS_Shape(entireBody);
          
          Bnd_Box bounding_box = entireAIS_Shape.BoundingBox();
          bounding_box.Get(xmin, ymin, zmin, xmax, ymax, zmax);
     }

thanks, best regards, juri
Jonathan Hill 2007/07/06 15:40
Hi Juri

private void TestBoundingBox(OpenCASCADE52.Visualization.TKV3d.AIS.Interfaces.IShape shape)
{
     IBox box = new Box();

     box.Gap = 0.0;

     if( shape != null )
          BRepBndLib.Add(shape.TopoDSShape, ref box);

     double xMin = 0;
     double yMin = 0;
     double zMin = 0;
     double xMax = 0;
     double yMax = 0;
     double zMax = 0;

     box.Get(ref xMin, ref yMin, ref zMin, ref xMax, ref yMax, ref zMax);
}

See if that works OK for you.

Best Regards
Jonathan
Juri Saragazki 2007/07/07 14:13
Hello Jonathan,

thank you very much for your suggestion. It works!
But i have some more questions. It was possible to create a box on a definied position like

BRepPrimAPI_MakeBox(gp_Pnt, x, y, z)

but i canīt find it now. I have only one possibility MakeBox(x, y, z).

And what about AIS_Trihedron. I cant find this class now???

Best regards,
Juri
Jonathan Hill 2007/09/16 12:13
Hi Juri,

Sorry for not replying, I've not had chance to check up on the forum for a while.

Do you still need feedback on your query?

Jonathan
YU XINGSHENG 2007/09/14 03:15
First thanks for your wrapper
I am a C# programer and new to OpenCascade coding,Now i am making a FEM software,want to display some text in the context like billboard,I just found the OpenCASCADE.Visualization.TKV3d.Prs3d.TextAspect,where I can found the Graphic2d_Text and create it use TextAspect,
In addition,the function Context.DisplayedObjects(ref IListOfInteractive list)'parameter 'IListOfInteractive',which class that implement the interface i use to create the parameter?is it ListOfInteractive?I create it,but I failed!

thank you very much!
Jonathan Hill 2007/09/16 12:20
Hi YU XINGSHENG,

I can look into adding support for the Graphic2d_Text class for you, could you tell me which methods and properties you would require, (this sometimes means including support for many of the other classes as well so it may take some time).

I'll also look at the ListOfInteractive parameter for you to.

Best Regards
Jonathan
YU XINGSHENG 2007/09/17 04:00
thanks for your kind works,I just want display some attributes such as the Node's and the Element's index,So,the text's properties best contain font(true type of SHX that supporting chiness),height,color,scale,etc.
otherwise,If you can add a 'Tag' property in the Shape class,so i can add the object which the shape represent to the Vertex,Edge,Face,Solid,etc.I want fetch the finite Element Object from the selected objects.
thanks very much again!
Robert Hill 2008/01/30 05:08
Hi Jonathon,

I had the same problem as someone else. I downloaded your zip file but after installation I tried to run it and got an error message that the MakeCompound method was not found. Thus, the bottle was not able to generate.

Any idea how I can correct this? I was just using the C# solution.

I was able to tinker with your solution and get some basic items to draw. I'm definitely interested in learning more about OpenCASCADE but I also want to use it in a C# solution.

Any feedback you can give is appreciated.

Thanks, R. Hill
Jonathan Hill 2008/02/03 21:20
Hi Robert,



Iíve updated the MakeBottle sample and you can download it from:- (watch out for the case sensitive path)



http://www.myxyz.co.uk/Downloads/Development/

Let me know if it works for you.

Jonathan

Claudio Benghi 2008/02/07 17:54
Hi Jonathan,

I've tried to intall this Feb 3rd version of Makebottle on different computers but apparently they all report a problem when registering OpenCASCADEX.dll in the system.

I've tried on 2 winxp pro systems both with .Net35 installed or not (during the setup .net35 is downloaded and installed).

I also tried to add the library to a solution references but again an error is thrown.

Fortunately I had a backup of the previous version so I'm continuing the development with your helpfil wrapper, but couldn't test the latest features.
Are there any pre-requisites I'm missing?

Thanks,
Claudio
Claudio Benghi 2008/02/14 19:12
Hello All,
I previously reported an error during the setup of the latest MakeBottle.
The error is thrown if VC++2008 redistributable files are not installed on the machine.
You can download it from MS website:
http://www.microsoft.com/downloads/details.aspx?familyid=9B2DA534-3E03-4391-8A4D-074B9F2BC1BF&displaylang=en
Best, Claudio
Ernest Abbott 2008/02/18 03:40
I've downloaded the version dated 17th Feb 2008. I have encountered a couple of problems.

1. The compiled version makebottle.exe cancels with an "attempt to read or write to protected memory". I have a screen shot of the failing message, including some of the exception text, if it is of any help.

2. I've opened the source file using C# express 2005. There seems to be a missing module "InteractiveCADViewControl.cs". So I'm not able to compile the program.

regards

Ernest Abbott
Michael Hill 2008/02/23 14:40
I'm having the same problem. Is there an older version I could look at instead?
Claudio Benghi 2008/02/23 22:32
Micheal, Earnest,

Jonathan is probably working on a more advanced control, but the 17 Feb version can run if you replace the missing class with a "CADViewControl".

Best,
Claudio
Jonathan Hill 2008/02/24 23:08
Hi Ernest/Michael

I 've uploaded a MS-Visual 2005 'MakeBottle' for you try out.

http://www.myxyz.co.uk/Downloads/Development/MakeBottle_2005.zip

Let me know if your have any problems.

Best Regards.
Jonathan
Robert Hill 2008/02/26 04:27
Hi Jonathan,

Thanks for all your great work on your wrapper. I've been experimenting and have run into a problem. I am trying to select an object to modify it. When I try to run the following code:

OpenCASCADE.Visualization.TKV3d.AIS.Shape tempShape;
tempShape = (OpenCASCADE.Visualization.TKV3d.AIS.Shape)viewControl.Context.SelectedInteractive;

I get an InvalidCastException error message that it is unable to cast the object. It seems that this should work. Can you tell me if I am doing something wrong?

Another question I had is: do you implement any of the OCAF package in your wrapper?

Best regards,
Robert
Stephen Leary 2008/08/12 13:18
Download link is not working anymore.

Does anyone have a copy posted anywhere?

Stephen
Jonathan Hill 2008/08/13 00:11
Hi Stephen,

Iíve updated the MakeBottle sample and you can download it from:- (watch out for the case sensitive path)


http://www.myxyz.co.uk/Downloads/Development/

Also, I've included an AISSelect.zip sample.


Jonathan
Guido van Hilst 2008/10/07 13:13
Hi Jonathan,
I cant get the download from :http://www.myxyz.co.uk/Downloads/Development/

Can you please update the download link?

Many thanks,

Guido
vv 2008/12/08 15:29
Hi
Same here, where can we find a wrapper to download?
10x
Rajendra 2010/04/19 10:41
Sorry couldnot download from the link..:(
Like to see the code.
thank you
Artem Chernetzov 2008/04/04 08:55
Couldn't find a Shape.Location property... How to locate shapes with wrapper?
And more complex task: I try to create composite solid from solids (like assembly from parts in Solid Works), so:
1) How create solid from shape? (I create cylinder with MakeCylinder.Shape)...
2) How create for example cone solid, that locate at the top of cylinder? (like cap), and this must be different parts, not one solid body... And how rotate solids?...
3) How enable wireframe view? :) In original tutorial: button "Hidden ON"
Thanks
 
 
Latest news
  • New features to enhance the development process
  • Open CASCADE Technology 6.7.1 is available for download!
  • Open CASCADE Technology 6.7.0 is available for download!

  • © OPEN CASCADE 2000 - 2014  |  Search  |  Contacts   |  Site map