×
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

CATScript/VBA for Sketch Analysis

CATScript/VBA for Sketch Analysis

CATScript/VBA for Sketch Analysis

(OP)
Does anyone know of a way to use a macro in CATIA V5 R23/24 to activate and read the results from a Sketch Analysis on a CATDrawing?

I would like to end or perhaps pause a script if the geometry is open.

RE: CATScript/VBA for Sketch Analysis

open ?

Eric N.
indocti discant et ament meminisse periti

RE: CATScript/VBA for Sketch Analysis

(OP)
Ok. Now if I could find an API reference on what to open (and read) that would be very helpful.

RE: CATScript/VBA for Sketch Analysis

can you be a bit more specific about what you need to analyze?

Eric N.
indocti discant et ament meminisse periti

RE: CATScript/VBA for Sketch Analysis

(OP)
There is a tool withing the Drafting Workbench of CATIA (when you open a CATDrawing) called Sketch Analysis. It reports how many profiles there are and whether they are Closed Profiles (such as a polygon or circle) or Open Profiles (such as an arc, spline or line).

I want to activate that tool and read its output using CATScript.

RE: CATScript/VBA for Sketch Analysis

(OP)
Thank you, Fernando. I'll give that a try when I return to work. Do you know what the return type of ”Sketch Solving Status” is?

RE: CATScript/VBA for Sketch Analysis

(OP)
If I wanted a macro to read in the lines of output from that window, would you know how to go about that?

Ultimately I'm trying to achieve diverging like:

If more than one profile or profile1 is open then
Prompt the use to fix the profile
Pause the macro
End If

RE: CATScript/VBA for Sketch Analysis

(OP)
I apologize for that last post. My phone thinks it knows what I'm trying to say and often gets it wrong.

I'm trying to achieve something like this:

If there is more than 1 profile or profile1 is open then
Prompt the user to fix the geometry
Pause the macro until they do
Check again
End if

RE: CATScript/VBA for Sketch Analysis

(OP)
Fernando,

This fix worked to open up the Sketch Analysis window. Thank you!

Do you know if there's a way to read in the data that it puts out into VBA? I'm trying to avoid human interaction if possible here.

Thanks again.

RE: CATScript/VBA for Sketch Analysis

(OP)
Ha! Very funny. Our designers are unfortunately spending too much time looking at every single DXF, when they only need to fix the ones that have geometry that is not closed. Tedious.

Anyway, do you think this might be approachable through CAA or some other means?

I don't think you can use the search tools to find out if some geometry is open or closed. Or can you?

RE: CATScript/VBA for Sketch Analysis

I would look into this:

try to make a pad from your sketch => if error tell user to fix

search all face in pad, define a new reference with first face.

trim (remove lumb) with ref face, then try to get volume, if you have one then profile is not single profile => ask user to fix

remove trim, remove pad

Eric N.
indocti discant et ament meminisse periti

RE: CATScript/VBA for Sketch Analysis

(OP)
Thank you, Eric. That sounds like a very workable idea! I don't yet know how to do much of what you explained but I get the concept and I'll research it.

Perhaps you could just explain one question. What do you mean by trim (remove lumb)?

RE: CATScript/VBA for Sketch Analysis

search catia online doc

Eric N.
indocti discant et ament meminisse periti

RE: CATScript/VBA for Sketch Analysis

(OP)
I understand. And thank you for your suggestion. I will look that up when I need it, although I've realized I really just need to know if the shape is made without error. Quantity of bodies can be ignored for now.

However, I cannot get the Copy-Paste method to work. When I record the copy and paste within the "Record Macro", I get the copy, but the paste is just a list of the items created manually. So, the copy works fine. But .Paste is not a method of Factory2D or Sketch. I am assuming that I have to create a reference of the "Copy", but I'm not exactly clear from the documentation I have on how to put that reference into a part sketch. Is there a link someone has that explains it clearly?

RE: CATScript/VBA for Sketch Analysis

(OP)
Scratch that. I was trying to search for, then copy-paste all of the geometry. I switched to copy-paste the view, and it all worked out fine. SOLVED!

RE: CATScript/VBA for Sketch Analysis

glad it worked :)

Eric N.
indocti discant et ament meminisse periti

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