Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Optimal Bounding Box 5

Status
Not open for further replies.

cilici

Mechanical
Dec 2, 2016
134
RO
Hello,

I've developed an application to compute the minimum/optimal Bounding Box. More info here. Activate the subtitles for more details.
It has been tested on two systems only (R21 and R27 on Win7 64bits) so have mercy. [bow]

The download link is in the description.

It is free to use, distribute and so on.

As usually, any feedback (especially the negatives) is welcome.

Calin
 
Replies continue below

Recommended for you

@ Fernando...

Yeah.. kinda.. but fully automated, using the Method from "A minimum bounding box algorithm and its application to rapid prototyping, by C K Chan and S T Tan"... see how well EKL can do the job...
I did a manual test using their algorithm and it works, now I need to automate the process... I like the silhouette curve/surface function... it does help. That will be my after COE project if I still have CATIA at home! I will publish in eng-tips... showing how to build it...

Eric N.
indocti discant et ament meminisse periti
 
Hello,

@Ferdo:
The error is coming when I want to select PartBody and if I click on continue the app is disappearing
Where did you click continue? Button or what?
When there is only one solid body, body selection button is disabled.
The app is not always on top for usability reasons. Instead, I prefer to hook it to CATIA window.

The two surfaces/faces/planes selection is not mandatory. You can select none, one or two (it is your choice). If you want to select two elements to determine two faces of the bounding box, it is intuitive (imho) that the two elements must be perpendicular to each other. Anyways, once you'd get the warning message you get the point for future uses.

@jzecha: It looks like there is a problem loading some libraries or CATIA is not correctly registered on your system.

Obviously, without a proper diversity of test environments, I intentionally did not handled all errors in order to get information about the errors source.
I've posted version 1.3.0.0 which handles bulky all possible loading errors (hopefully)
 
@cilici: Can you give me a little more information on what you are referring too?
I can have my IT department look into it.

I have 7 Catia V5 R20 through R2017 installed on my computer, so once I get past my initial issues, I can test this on all the versions I have to help you out.
 
Hi Calin

If you need, we can try a TeamViewer meeting when you have time somewhere in the afternoon, you know how to contact me. Is Continue button in the error message.

Capture_v5gfou.jpg


Capture_1_eptkzq.jpg


Regards
Fernando

- Romania
- EU
 
@Ferdo: Thank you, I will take you up on that.

@jzecha: could you please try the version 1.3.1.0 that is available for download?

Also, for both, please mention the OS you are using.

Thank you all!
Calin
 
I am running Windows 10 Pro.

Currently I have only tested it on R2015.
A few suggestions and comments I have are:
1. I would like the ability to change unites on Offset and Output.
2. Add a button to the tool to delete everything it created. (Bodies, Parameters, and Rules)
3. When I run it, it does not put any of the information in the Body name like the video shows. (Offset, Dimensions, and Volume are only shown in Parameters)

I tried out a bunch of the functionality and it worked really well, good job on this build.

The only issue I found was that I was only able to use the Basic Precision.
When I tried Normal, Good, Best, and I got spare time, they all yielded the same error:

Error HRESULT E_FAIL has been returned from a call to a COM component.

Details are:

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.
at SPATypeLib.Measurable.get_Area()
at BoundingBox.BoundingBox.EditAngle(Object myAngle, Object mySurface, Object iAmplitude, Object iStep, Object oPart)
at BoundingBox.BoundingBox.cmdOK_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.7.2633.0 built by: NET471REL1LAST_C
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
BoundingBox
Assembly Version: 1.3.1.0
Win32 Version: 1.3.1.0
CodeBase: file://netapp2/Users/Redirection/jzecha/Desktop/BoundingBox.exe
----------------------------------------
Microsoft.VisualBasic
Assembly Version: 10.0.0.0
Win32 Version: 14.7.2556.0 built by: NET471REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualBasic/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.7.2556.0 built by: NET471REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.7.2633.0 built by: NET471REL1LAST_C
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.7.2556.0 built by: NET471REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.7.2556.0 built by: NET471REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.7.2556.0 built by: NET471REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.7.2612.0 built by: NET471REL1LAST_B
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Runtime.Remoting
Assembly Version: 4.0.0.0
Win32 Version: 4.7.2556.0 built by: NET471REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Remoting/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
----------------------------------------
CustomMarshalers
Assembly Version: 4.0.0.0
Win32 Version: 4.7.2556.0 built by: NET471REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_32/CustomMarshalers/v4.0_4.0.0.0__b03f5f7f11d50a3a/CustomMarshalers.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
 
@jzecha: Thank you for your time!

1. That is doable, although I don't like complicating the UI.
2. Done. However, deletion is restricted only to the last bounding box created and only as long as the user doesn't close the interface.
3. Click on the little i in the bottom left corner. That is something I wanted to have for debugging then I thought it might be interesting for some users so I hide it there [wink]

About the error: it looks like SPAWorkbench is creating problems for some users so I completely removed all references to it.
What license exactly are you using if I may ask?

The version 1.4.0.0 is available for download.
This update includes removal of SPAWorkbench reference, the addition of Undo/Delete button and additional fixes.

Thank you again.
 
@cilici:

1. I understand on the units, I only asked since I pretty much exclusively use the Inches since I work in the US.
2./3. These features work great.

I tested it on R2016 today, the only Precision I could get to work was Basic unless I selected Face 1 and 2 then it worked.

When the other Precisions failed, it just had a Pop Up Box stating: BoundingBox creation failed!

The license I tested it on was:
CAC + FTX + HDX + MCE
 
@jzecha:
Could you please run the following code? You must have a CATPart opened and any surface selected.
Let me know if/where it crashes. I sure hope it's not :))

Code:
Sub Test()
    Set oPartDoc = CATIA.ActiveDocument
    Set TheSPAWorkbench = oPartDoc.GetWorkbench("SPAWorkbench")
    Set mySurface = oPartDoc.Selection.Item(1).Value
    Set mX = TheSPAWorkbench.GetMeasurable(mySurface)
    iArea = mX.Area
    MsgBox iArea
End Sub

Thanks,
Calin
 
@cilici
I ran this code as CATScript and nothing happened.

I then ran it as catvbs and it failed.
I changed the first line of code to Sub CATMain() and it appears to have performed correctly.
I got a MsgBox with number in it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top