Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Hi there I want to create a m

Status
Not open for further replies.

wassimo

Automotive
Nov 1, 2016
2
TN
Hi there


I want to create a macro in catia v5 that colored the operation of Part Design, for example :

when you make a "split" the operation will be colored automatically by a defined color.

There is someone who can help me ?
 
Replies continue below

Recommended for you

i can help

start coding...and explain where is your problem i will help (but I won't do your job)

Eric N.
indocti discant et ament meminisse periti
 
hi,

thank you for the answer.
I tried to enter the codes but I want to insert a request if possible, for example:
the macro should be looking in a solid(PartBody) and not in Geometrical Set.
Thank you for your help.

Below an example:

Sub CATMain()

Dim partDocument1 As PartDocument
Set partDocument1 = CATIA.ActiveDocument

Dim selection1 As Selection
Set selection1 = partDocument1.Selection

selection1.Search "CATPrtSearch.Fillet,sel"

Set selection1 = CATIA.ActiveDocument.Selection

Set visPropertySet1 = selection1.VisProperties
visPropertySet1.SetRealColor 255, 255, 128, 1

selection1.Clear

End Sub
 
Hi,

There are multiple options, you have to think a little bit what you want.

For example, you can ask user to select first something (in your case the PartBody), or you can select first directly in the macro without asking user the PartBody and then, inside that selection, you can search whatever type of element you want.

It can be done also in different ways but you have also to specify what are you using: CATScript or catvba or something else (from how is looking your code I suppose you don't use catvbs).

Also, when you start to program in CATIA, take in consideration where that macro will be used (which OS, what CATIA version or release, is a CATIA network installation or not).



Regards
Fernando

- Romania
- EU
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top