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.
Author
Discussion
37 archived replies
Posts are displayed in their archived order.
01Commenter-1
Hello Author,
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
Commenter-1
02Commenter-2
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
Commenter-2
03Commenter-3
Cool! Thank you!!!
04Commenter-3
Hi, Author
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!
05Author
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
Author
06Commenter-3
How can I get your EMAIL?
07Commenter-3
Hello, Author
Please give me your EMail,I can send the code to you. Thank you!
08Author
Hi zhangbing
JonathanHilljonpcdemoncouk
Author
09Author
Hi zhangbing,
I'm trying to send an attachment to your e-mail address, but it just fails to deliver.
Author
10Commenter-3
Hi Author,
I've received your e-mail, I try to debug again, it works perfect!
Thanks for your help!
Best regards
11Commenter-4
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.
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.
Commenter-4
12Author
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
Author
13Commenter-4
Hello Author,
and it worked perfectly using the new index start.
Thank you for the immediate help.
Best Regards,
Commenter-4
14Commenter-5
Hi Author,
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.
15Commenter-6
Hi Author,
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);
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,
Commenter-6
18Author
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?
Author
19Commenter-7
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!
20Author
Hi Commenter-7,
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
Author
21Commenter-7
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!
22Commenter-8
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
23Author
Hi Robert,
I’ve updated the MakeBottle sample and you can download it from:- (watch out for the case sensitive path)
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,
Commenter-9
25Commenter-9
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-4...
Best, Commenter-9
26Commenter-5
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
Commenter-5
27Commenter-10
I'm having the same problem. Is there an older version I could look at instead?
28Commenter-9
Micheal, Earnest,
Author 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,
Commenter-9
29Author
Hi Ernest/Michael
I 've uploaded a MS-Visual 2005 'MakeBottle' for you try out.
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:
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,
Commenter-8
31Commenter-11
Download link is not working anymore.
Does anyone have a copy posted anywhere?
Commenter-11
32Author
Hi Stephen,
I’ve updated the MakeBottle sample and you can download it from:- (watch out for the case sensitive path)
Hi
Same here, where can we find a wrapper to download?
10x
35Commenter-14
Sorry couldnot download from the link..:(
Like to see the code.
thank you
36Commenter-15
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
37Commenter-12
Hi
I have made atomated wrappers c# wrappers for all of occ;
And also added lot of extension methods, to make it real easy to use OCC in c#