×
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

Automatic feature classification into geometrical set

Automatic feature classification into geometrical set

Automatic feature classification into geometrical set

(OP)
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

 

RE: Automatic feature classification into geometrical set

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
 

RE: Automatic feature classification into geometrical set

(OP)
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

 

RE: Automatic feature classification into geometrical set

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

Regards
Fernando
 

RE: Automatic feature classification into geometrical set

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
 

RE: Automatic feature classification into geometrical set

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
 

RE: Automatic feature classification into geometrical set

(OP)
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

RE: Automatic feature classification into geometrical set

(OP)
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

 

RE: Automatic feature classification into geometrical set

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
 

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