Continue to Site

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!

desactivate bodies and feature with rule

Status
Not open for further replies.

sbmjpb

Mechanical
Aug 22, 2013
12
hi everybody,

do you know how to create a rule to desactivate all bodies and features contained in a part without selected all features one by one?

thanks
 
Replies continue below

Recommended for you

not a solution, but left click on the first feature, press and hold shift, left click on the last feature (that you want to deactivate). then right click on any selected feature, selected objects, deactivate.
 
Hi,

Same action described by Loki you will have with a CATScript like bellow:

Code:
Language="VBSCRIPT"

Sub CATMain()

Dim partDocument1 As Document
Set partDocument1 = CATIA.ActiveDocument

Dim selection1 As Selection
Set selection1 = partDocument1.Selection

selection1.Search "Name=*Body*,all"

Dim selection2 As Selection
Set selection2 = partDocument1.Selection

selection2.Search "CATPrtSearch.MechanicalFeature,sel"
CATIA.StartCommand "Deactivate Terminal Node"
End Sub



Regards
Fernando

 
The macro Ferdo supplied is the way to go. A rule can be executed multiple times and this could slow your process.

Perhaps you want the features locked as deactivated?

Win XP64
21SP7/22SP5, 3DVIA Composer 2013X, ST R20
Dell T7400 16GB Ram
Quadro FX 4800 - 1.5GB
 
sorry gents, I was unabble to respond.
I have read all suggested respond but what i want to do is to desactivated a body and all features contains on it.
I have a skeleton of my system on a part with all body including boolean operations and i have create some parameters to desactivate some bodies to modified to final design of the system.
to avoid troubles with bodies I need to desactivated bodies whose are not usefull.
I dont't know if a rules can be launch a vb script as suggested by fredo.
 
sbmjpb

You could set it up like this using parameters with rules.

getfile.aspx


The rule or formula will activate/deactivate the bodies.


getfile.aspx





Win XP64
21SP7/22SP5, 3DVIA Composer 2013X, ST R20
Dell T7400 16GB Ram
Quadro FX 4800 - 1.5GB
 
Expert rules:

b:body

b.Activity = False

Where is the problem?

Eric N.
indocti discant et ament meminisse periti
 
itsmyjob, can you put a condition in an expert rule?
for example

if boolean.1 == false
(
d.Ativity = false
}
else
(
d.Ativity = true
}
 
did you try?

Eric N.
indocti discant et ament meminisse periti
 
yes but I cannot select the boolean parameter to write the condition
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor