×
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

Macro to remove geoset

Macro to remove geoset

Macro to remove geoset

(OP)
I'm trying to do a macro that will remove the selected geo set while keeping the content.
There is already a function in Catia that does this called "Remove Geographical Set" but the macro recorder does not catch it and I can't find it in HybridBody objects

Alternatively I was thinking of manually moving everything in the GS before it and then deleting it but it's a bit past my skill.

Anyone able to help me ? I'm experienced in VBA/VB.Net but totally new to Catia API so any exemple is welcome

Thanks !

RE: Macro to remove geoset

Remove Geoset will only remove the geoset...not the features inside...I think you can access it from the StartCommmand. Look at View > Command List to see the strings for StartCommand. If you want to delete the stuff inside you can delete the geoset and it will automatically delete everything inside...beware, if any other features are children to the ones you deleted, they will not update.

In its simplest form:

CODE --> VA

'load part and add geoset to selection then run macro
sub RemoveGeoset()

If Catia.activedocument.Selection.count > 1 then
CATIA.StartCommand ("Remove Geographical Set")
End if end sub

To delete the geoset:

CODE --> VA

'load part and add geoset to selection then run macro
sub DeleteGeoset()

If Catia.activedocument.Selection.count > 1 then
CATIA.activedocumnet.selection.delete ("Remove Geographical Set")
End if end sub

It would be worth you looking at the V5Automation.chm file to get started with CATIA macros.

RE: Macro to remove geoset

(OP)
@lardman

Thanks ! I did not know about CATIA.StartCommand. I have browsed V5Automation.chm but it is a mess (least compared to Solidworks Api Help)

@ferdo

It is a GSD geoset either in a catpart windows or in a catpart in a catproduct with Catia V5 and VBA

RE: Macro to remove geoset

Hi,

The logical process should be (and is not quite all):

- select the GS
- copy everything inside
- get the name of GS
- activate the CATPart where is this GS
- create a new temporary GS
- select the new GS and paste everything from memory inside
- search and delete old GS, you already know the name

Simple, isn't it? Parts of all this process can be found in V5Automation.chm or CATIA_Portable_Script_Center.

Regards
Fernando

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

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