• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

ilogic - cycle if/then/else if works badly

  • Thread starter Thread starter Ing.filippo
  • Start date Start date

Ing.filippo

Guest
Good morning to all,
I modeled an inventor panel and this panel has holes. the number of holes varies according to the panel height. I have identified the ranges of heights and the respective number of holes, but when I go to write the ilogic rule this does not work properly because it considers me only the first range of measures I entered. What am I wrong in the programming of the rule?

attached ilogic rule and panel pattern with parameters.
thanks to all
Code:
'altezze pannelli che prevedono 2 fori

if (altezza_pannello - y_foro) <350 mm  then
        interasse_1 = 160 mm           
            feature.isactive("foro1") = true
            feature.isactive("foro2") = true
            feature.isactive("foro3") = false
            feature.isactive("foro4") = false
            feature.isactive("foro5") = false
            feature.isactive("foro6") = false
    elseif 351 mm <(altezza_pannello - y_foro) < 500 mm    then   
        interasse_1 = 320 mm
            feature.isactive("foro1") = true
            feature.isactive("foro2") = true
            feature.isactive("foro3") = false
            feature.isactive("foro4") = false
            feature.isactive("foro5") = false
            feature.isactive("foro6") = false
    elseif 501 mm <(altezza_pannello - y_foro) < 650 mm then
            interasse_1 = 480 mm
            feature.isactive("foro1") = true
            feature.isactive("foro2") = true
            feature.isactive("foro3") = false
            feature.isactive("foro4") = false
            feature.isactive("foro5") = false
            feature.isactive("foro6") = false
        
'altezze pannelli che prevedono 3 fori   
    
else if 651 mm <(altezza_pannello - y_foro) <820 mm then
        interasse_1 = 320 mm
        interasse_2 = 320 mm
            feature.isactive("foro1") = true
            feature.isactive("foro2") = true
            feature.isactive("foro3") = true
            feature.isactive("foro4") = false
            feature.isactive("foro5") = false
            feature.isactive("foro6") = false
    elseif 821 mm<(altezza_pannello-y_foro) <980 mm then
        interasse_1 = 320 mm
        interasse_2 = 480 mm
            feature.isactive("foro1") = true
            feature.isactive("foro2") = true
            feature.isactive("foro3") = true
            feature.isactive("foro4") = false
            feature.isactive("foro5") = false
            feature.isactive("foro6") = false
        elseif 981<(altezza_pannello - y_foro) <1150 mm then
            interasse_1 = 480 mm
            interasse_2 = 480 mm
            feature.isactive("foro1") = true
            feature.isactive("foro2") = true
            feature.isactive("foro3") = true
            feature.isactive("foro4") = false
            feature.isactive("foro5") = false
            feature.isactive("foro6") = false
        elseif 1151 mm <(altezza_pannello - y_foro) < 1299 mm then
                interasse_1 = 480 mm
                interasse_2 = 640 mm
            feature.isactive("foro1") = true
            feature.isactive("foro2") = true
            feature.isactive("foro3") = true
            feature.isactive("foro4") = false
            feature.isactive("foro5") = false
            feature.isactive("foro6") = false

'altezze pannelli che prevedono 4 fori

else if 1300 mm <(altezza_pannello - y_foro) <1520 mm then
        interasse_1 = 480 mm
        interasse_2 = 480 mm
        interasse_3 = 320 mm
            feature.isactive("foro1") = true
            feature.isactive("foro2") = true
            feature.isactive("foro3") = true
            feature.isactive("foro4") = true
            feature.isactive("foro5") = false
            feature.isactive("foro6") = false
    elseif 1521 mm<(altezza_pannello) <1620 mm then
        interasse_1 = 640 mm
        interasse_2 = 480 mm
        interasse_3 = 320 mm
            feature.isactive("foro1") = true
            feature.isactive("foro2") = true
            feature.isactive("foro3") = true
            feature.isactive("foro4") = true
            feature.isactive("foro5") = false
            feature.isactive("foro6") = false
        elseif 1621 mm<(altezza_pannello - y_foro) <1900 mm then
            interasse_1 = 640 mm
            interasse_2 = 480 mm
            interasse_3 = 480 mm
            feature.isactive("foro1") = true
            feature.isactive("foro2") = true
            feature.isactive("foro3") = true
            feature.isactive("foro4") = true
            feature.isactive("foro5") = false
            feature.isactive("foro6") = false           

'altezze che prevedono 5 fori

else if 1900 mm <(altezza_pannello - y_foro) <2100 mm  then
        interasse_1 = 640 mm
        interasse_2 = 480 mm
        interasse_3 = 320 mm
        interasse_4 = 480 mm
        feature.isactive("foro1") = true
        feature.isactive("foro2") = true
        feature.isactive("foro3") = true
        feature.isactive("foro4") = true
        feature.isactive("foro5") = true
        feature.isactive("foro6") = false
else if 2101 mm <(altezza_pannello - y_foro) <2400 mm  then
        interasse_1 = 640 mm
        interasse_2 = 480 mm
        interasse_3 = 320 mm
        interasse_4 = 640 mm
        feature.isactive("foro1") = true
        feature.isactive("foro2") = true
        feature.isactive("foro3") = true
        feature.isactive("foro4") = true
        feature.isactive("foro5") = true
        feature.isactive("foro6") = false
        
'altezze che prevedono 6 fori

else if 2401 mm <(altezza_pannello - y_foro) <2700 mm  then
        interasse_1 = 640 mm
        interasse_2 = 480 mm
        interasse_3 = 320 mm
        interasse_4 = 640 mm
        interasse_5 = 480 mm
        feature.isactive("foro1") = true
        feature.isactive("foro2") = true
        feature.isactive("foro3") = true
        feature.isactive("foro4") = true
        feature.isactive("foro5") = true
        feature.isactive("foro6") = true
    elseif (altezza_pannello-y_foro) >2701 mm  then
        interasse_1 = 640 mm
        interasse_2 = 480 mm
        interasse_3 = 320 mm
        interasse_4 = 640 mm
        interasse_5 = 640 mm   
        feature.isactive("foro1") = true
        feature.isactive("foro2") = true
        feature.isactive("foro3") = true
        feature.isactive("foro4") = true
        feature.isactive("foro5") = true
        feature.isactive("foro6") = true
        end if
Pannello inventor.webp
 
(351 mm < = height_pannello - y_foro)) and (height_pannello - y_foro) <= 500 mm)

I would say it's a syntax problem
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
Back
Top