×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

CATIA Sketch 2D "Bounding Rectangle"

CATIA Sketch 2D "Bounding Rectangle"

CATIA Sketch 2D "Bounding Rectangle"

(OP)
I'm now at the point I often run into with CATIA VBA. I know what I want to do. I've spent hours looking for the tools in forums and in the help files, that I need to get it done. And I end up getting nowhere.

I want to make a Macro that creates a Bounding Rectangle with the default axis system of all geometry that exists in a sketch within a CATPart. I think my strategy should be to go through every geometry, find its X and Y extrema (largest and smallest) and keep cycling until I know the largest and smallest X and Y of all geometry and make a box using that data.

I found HybridShapeExtremum, but that seems to only apply to geometry from the GSD workbench, and I want sketch geometry. Would anyone know how to go about solving this?

RE: CATIA Sketch 2D "Bounding Rectangle"

There is not an extreme command inside the Sketching workbench. What about finding the extreme points of the sketch in the direction of Sketch H,V. Project the points into the sketch and create a box from this geometry?

I attached a bounding box script that would need a little modification to produce what you are looking for.

Regards,
Derek

Win 7
23SP5/24SP3, 3DVIA Composer 2015

RE: CATIA Sketch 2D "Bounding Rectangle"

(OP)
Yes, thank you DBezaire. I do have that script. It is a part of the CATIA Portable Script Center from Fedro. But in order to use that for my sketch, I would have to Sweep the Sketch and create an Axis System in the orientation of the Sweep, and then delete all of that to get my data, and then go back in the sketch and use that data to create the rectangle ...

It seems like I wouldn't be doing all of this in the most efficient way. Surely there has to be a more efficient approach. Maybe?

RE: CATIA Sketch 2D "Bounding Rectangle"

Brian, in my opinion, not everything should be solved in vb (even if I'm a big fun of solving different tasks in this way) and this "bounding box" is one of them.

Maybe is better to create a UDF based on something similar like here . The idea is to create a rectangle around the sketch and rotate that rectangle (or the sketch) in order to obtain the minimum area for rectangle. In this way you will obtain the minimum x and y dimensions. Anyway, I don't think there is a quick solution for this.

I suppose you want this especially for unfolded SMD parts (I know this is a problem for brackets with complex shape).

Regards
Fernando

https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU

RE: CATIA Sketch 2D "Bounding Rectangle"

(OP)
Thank you, fedro! That gave me a very good idea.

My box can be slightly large if needed without causing me any issue. So I will create equally spaced construction points on all curves of maybe 0.05" spacing, then take the max/min X and max/min Y of each point. Then create a box around those dimensions and oversize it by 0.025" on each side. That will guarantee that all curves are within the bounding box.

Perfect!

RE: CATIA Sketch 2D "Bounding Rectangle"

(OP)
Ok. So it appears I was over-eager. Is there no way to create points in a sketch through VBA by creating evenly spaced points along a line, circle, nurb, etc?

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources