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!

refresh loop on a rule that calls an action

Status
Not open for further replies.

romaleee

Mechanical
May 13, 2016
37
HR
Hello

can anyone please explain to me why this rule has infinitive refresh problem?

Code:
Let OpenBodyFeature1 (OpenBodyFeature)
Let OpenBodyFeature2 (OpenBodyFeature)
Let OpenBodyFeature3 (OpenBodyFeature)
Let OpenBodyFeature4 (OpenBodyFeature)

set OpenBodyFeature1 = `Geometrija izvoda\NN_strana\NN_gore_unutarnji` 
set OpenBodyFeature2 = `Geometrija izvoda\NN_strana\NN_gore_vanjski` 
set OpenBodyFeature3 = `Geometrija izvoda\NN_strana\NN_dolje_unutarnji` 
set OpenBodyFeature4 = `Geometrija izvoda\NN_strana\NN_dolje_vanjski` 

if Dvije_sekcije == "DA"
{
	Relations\Rules\Izvodi\Promijeni_status_aktivacije   ->Run(OpenBodyFeature1 ,true)
	Relations\Rules\Izvodi\Promijeni_status_aktivacije  ->Run(OpenBodyFeature2 ,true)
	Relations\Rules\Izvodi\Promijeni_status_aktivacije  ->Run(OpenBodyFeature3 ,true)
	Relations\Rules\Izvodi\Promijeni_status_aktivacije  ->Run(OpenBodyFeature4 ,true)
}
else
{
	Relations\Rules\Izvodi\Promijeni_status_aktivacije   ->Run(OpenBodyFeature1 ,false)
	Relations\Rules\Izvodi\Promijeni_status_aktivacije  ->Run(OpenBodyFeature2 ,false)
	Relations\Rules\Izvodi\Promijeni_status_aktivacije  ->Run(OpenBodyFeature3 ,false)
        Relations\Rules\Izvodi\Promijeni_status_aktivacije  ->Run(OpenBodyFeature4 ,false)
}

Relations\Rules\Izvodi\Promijeni_status_aktivacije is an action:

inputs:

Code:
geoSet :  OpenBodyFeature,visState :  Boolean

Code:
let GF_Children (List)
let SK_Children (List)
Let GeometricFeature1 (GeometricFeature)
Let Sketch1 (Sketch)

GF_Children = geoSet ->Query("GeometricFeature","")
SK_Children = geoSet ->Query("Sketch","")

for GeometricFeature1 inside GF_Children
{
	GeometricFeature1.Activity = visState	
}

for Sketch1 inside SK_Children 
{
	Sketch1.Activity = visState	
}

Capture_liphp5.jpg
 
Replies continue below

Recommended for you

i have the feeling that when you change the value to YES it trigger the action as something in the file changed. also when you change the activity to yes or no you trigger another action as something changed...

you might need to create a parameter flag and set proper value to run your action only once.

maybe something like

Code:
if Dvije_sekcije == "DA" and runOnceFlag 
{
	runOnceFlag = False
	Relations\Rules\Izvodi\Promijeni_status_aktivacije   ->Run(OpenBodyFeature1 ,true)
	Relations\Rules\Izvodi\Promijeni_status_aktivacije  ->Run(OpenBodyFeature2 ,true)
	Relations\Rules\Izvodi\Promijeni_status_aktivacije  ->Run(OpenBodyFeature3 ,true)
	Relations\Rules\Izvodi\Promijeni_status_aktivacije  ->Run(OpenBodyFeature4 ,true)
	runOnceFlag = True
}
else
{
	runOnceFlag = False
	Relations\Rules\Izvodi\Promijeni_status_aktivacije   ->Run(OpenBodyFeature1 ,false)
	Relations\Rules\Izvodi\Promijeni_status_aktivacije  ->Run(OpenBodyFeature2 ,false)
	Relations\Rules\Izvodi\Promijeni_status_aktivacije  ->Run(OpenBodyFeature3 ,false)
        Relations\Rules\Izvodi\Promijeni_status_aktivacije  ->Run(OpenBodyFeature4 ,false)
	runOnceFlag = True
}

Eric N.
indocti discant et ament meminisse periti
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top