Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Automatic feature classification into geometrical set

Status
Not open for further replies.

Vertx

Automotive
Jan 16, 2012
10
0
0
CA
Hi,

I would like to know if somebody has a method/script/macro to automate the classification of features into respective geometrical sets (CATIA V5).

Example : Creating a "Line" would put it under the geometrical set "Line" even if this particular geometrical set is not "defined in work object".

I group all reference elements independently from my surfaces so I can hide all the wire-frame geometry at once.

Alternately, a macro for showing/hiding all wire-frame geometry would work, but I would prefer to have the same features grouped together for the tree's sake.

Thank you very much

 
Replies continue below

Recommended for you

Hi,

If I understood you well, that means after creating a feature (for example a line) you want to run a macro to pick-up the feature (line in this case) and put it in a specific GS (selected by you or predefined), isn't it ?

This can be done without problems.

Regards
Fernando
 
Precisely, except that I would rather have something that does it in real time if possible, instead of a macro that has to be launched.

Thank you for your reply Fernando, much appreciated

 
In real time I believe is not so easy because there are too many ways to create a feature...let me think...

Regards
Fernando
 
I just realize that it will be much easier to do what you want if you search a specific feature at the end of the work (let say lines) and just CHANGE one type of feature (lines) in a specific Geometrical Set - Change Geometrical Set

Regards
Fernando
 
This is just a simple CATScript


Language="VBSCRIPT"

Sub CATMain()

Dim partDocument1 As Document
Set partDocument1 = CATIA.ActiveDocument

Dim selection1 As Selection
Set selection1 = partDocument1.Selection

selection1.Search "CATPrtSearch.Line,all"

Dim part1 As Part
Set part1 = partDocument1.Part

CATIA.StartCommand "Change geometrical Set"

part1.Update

End Sub


Regards
Fernando
 
I get this error message...

Source : Microsoft VBScript compilation error
Description : Expected end of statement
Statemenet : Dim partDocument1 As Document

I'm a newbie with scripts...

Thanks Fernando
 
Wow, works perfectly! I owe you a beer ;)

I've created some for planes, points, sketches also...
Where can I find the feature name's list to correctly designate the other one? (Spline or 3D curve perhaps)


Another quick question ; let's say I create an extrusion and I define the direction by creating a line within the extrusion direction's contextual menu. The line will be under the extrusion's node in the tree, hidden. That's fine by me... Is there a possibility to skip the features that are defined this way?

Again, thank you very much for your time
Best,

Mat

 
First question: push CTRL+F and look in Advanced Search Tab for Part Design Workbench.

Second question: you have the possibility to exclude from a selection different things, you just need to find the criteria...maybe an example uploaded here it will be much helpful to find a solution.

The CATScript is done by simply recording and just add a StartCommand line at the end...is really nothing fancy...and for sure can be improved (in catvba, with graphic interface, buttons, less clicks, a.s.o.), you need just a little time - unfortunately I don't have now so much..


Regards
Fernando
 
Status
Not open for further replies.
Back
Top