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.
I would like to end or perhaps pause a script if the geometry is open.





RE: CATScript/VBA for Sketch Analysis
indocti discant et ament meminisse periti
RE: CATScript/VBA for Sketch Analysis
RE: CATScript/VBA for Sketch Analysis
indocti discant et ament meminisse periti
RE: CATScript/VBA for Sketch Analysis
I want to activate that tool and read its output using CATScript.
RE: CATScript/VBA for Sketch Analysis
As far as I know, to activate that tool you can use CATIA.StartCommand "Sketch Analysis" or CATIA.StartCommand "Sketch Solving Status"... but...all GeneratedItem are iso-constrained (coming from 3D), drawn elements are under-constrained (if they are not fixed or constrained in another way).
Regards
Fernando
https://picasaweb.google.com/102257836106335725208
https://picasaweb.google.com/103462806772634246699...
RE: CATScript/VBA for Sketch Analysis
RE: CATScript/VBA for Sketch Analysis
Regards
Fernando
https://picasaweb.google.com/102257836106335725208
https://picasaweb.google.com/103462806772634246699...
RE: CATScript/VBA for Sketch Analysis
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
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
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
I'm not aware about something like is, drafting is one of the worst workbenches in automation. Anyway, let designers live, don't automate everything
Regards
Fernando
https://picasaweb.google.com/102257836106335725208
https://picasaweb.google.com/103462806772634246699...
RE: CATScript/VBA for Sketch Analysis
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
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
indocti discant et ament meminisse periti
RE: CATScript/VBA for Sketch Analysis
Perhaps you could just explain one question. What do you mean by trim (remove lumb)?
RE: CATScript/VBA for Sketch Analysis
indocti discant et ament meminisse periti
RE: CATScript/VBA for Sketch Analysis
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
RE: CATScript/VBA for Sketch Analysis
Regards
Fernando
https://picasaweb.google.com/102257836106335725208
https://picasaweb.google.com/103462806772634246699...
RE: CATScript/VBA for Sketch Analysis
indocti discant et ament meminisse periti