Supress with iLogic with If funktion

Supress with iLogic with If funktion

Anonymous
Not applicable
1,002 Views
19 Replies
Message 1 of 20

Supress with iLogic with If funktion

Anonymous
Not applicable

Hello i made this rule ti surpress my parts (see the picture):

Unbenannt.JPG

I made this code but it doesent work when i edit my parameters from excel:

 

If Parameter("Mittelpfosten_vorhanden")=0 Then

Component.IsActive("Mittelpfosten:1") = False
Component.IsActive("Mittelpfosten:2") = False
Component.IsActive("Mittelpfosten:3") = False


End If

If Parameter("Mittelpfosten_vorhanden")=1 Then

Component.IsActive("Mittelpfosten:1") = True
Component.IsActive("Mittelpfosten:2") = False
Component.IsActive("Mittelpfosten:3") = False


End If

If Parameter("Mittelpfosten_vorhanden")=2 Then

Component.IsActive("Mittelpfosten:1") = True
Component.IsActive("Mittelpfosten:2") = True
Component.IsActive("Mittelpfosten:2") = False

End If

If Parameter("Mittelpfosten_vorhanden")=3 Then

Component.IsActive("Mittelpfosten:1") = True
Component.IsActive("Mittelpfosten:2") = True
Component.IsActive("Mittelpfosten:2") = True


End If

 

Can you help me?

 

 

 

 

 

 

 

 

 

 

 

0 Likes
Accepted solutions (2)
1,003 Views
19 Replies
Replies (19)
Message 2 of 20

CCarreiras
Mentor
Mentor

If Parameter("Mittelpfosten_vorhanden")=0 Then

Component.IsActive("Mittelpfosten:1") = False
Component.IsActive("Mittelpfosten:2") = False
Component.IsActive("Mittelpfosten:3") = False

 

ElseIf

 

Parameter("Mittelpfosten_vorhanden")=1 Then

Component.IsActive("Mittelpfosten:1") = True
Component.IsActive("Mittelpfosten:2") = False
Component.IsActive("Mittelpfosten:3") = False

 

ElseIf

 

 Parameter("Mittelpfosten_vorhanden")=2 Then

Component.IsActive("Mittelpfosten:1") = True
Component.IsActive("Mittelpfosten:2") = True
Component.IsActive("Mittelpfosten:2") = False

 

ElseIf

 

 Parameter("Mittelpfosten_vorhanden")=3 Then

Component.IsActive("Mittelpfosten:1") = True
Component.IsActive("Mittelpfosten:2") = True
Component.IsActive("Mittelpfosten:2") = True


End If

CCarreiras

EESignature

0 Likes
Message 3 of 20

rossano_praderi
Collaborator
Collaborator

This is faster, much more easy to read and to implement.

 

Select Case Parameter("Mittelpfosten_vorhanden")
	Case 0
		Component.IsActive("Mittelpfosten:1") = False
		Component.IsActive("Mittelpfosten:2") = False
		Component.IsActive("Mittelpfosten:3") = False
	Case 1
		Component.IsActive("Mittelpfosten:1") = True
		Component.IsActive("Mittelpfosten:2") = False
		Component.IsActive("Mittelpfosten:3") = False
	Case 2
		Component.IsActive("Mittelpfosten:1") = True
		Component.IsActive("Mittelpfosten:2") = True
		Component.IsActive("Mittelpfosten:2") = False
	Case 3
		Component.IsActive("Mittelpfosten:1") = True
		Component.IsActive("Mittelpfosten:2") = True
		Component.IsActive("Mittelpfosten:2") = True
End Select

Bregs

Rossano Praderi



--------------------------------------
If my post answers your question, please click the "Accept as Solution"
button. This helps everyone find answers more quickly!
---------------
Message 4 of 20

Anonymous
Not applicable

Hello Rossano and than you for the replay

 

i just tired to insert the rule but i doesent work. it doesen have effect when i change my parameters.

 

i renamed my LOD to iLogic

0 Likes
Message 5 of 20

CCarreiras
Mentor
Mentor

Both Rules are correct.

 

Maybe it's missing update...

 

place this below the rule:

 

SyntaxEditor Code Snippet

InventorVb.DocumentUpdate()

iLogicVb.UpdateWhenDone = True

 

 

If this doesnt work,

Post here the files and we will try it. 

CCarreiras

EESignature

0 Likes
Message 6 of 20

Anonymous
Not applicable

https://mega.nz/#!rxVliJja!fpYjph5-3bKBy1hQYGfUWiGmIMhI2zslqFxaBqwK8no

 

Here have you my files.

 

FGL assembly is with a excel FGL linked. You can make a model with 1 2 oder 3 Mittepfosten

 

 

0 Likes
Message 7 of 20

Anonymous
Not applicable

So i make it wokr (realy i dont knpw how)

 

Nut still, it doesent work riely fine. My case 3 doesent update when i change my parameter to 3.

 

If Parameter("Mittelpfosten_vorhanden")=0 Then

Component.IsActive("Mittelpfosten:1") = False
Component.IsActive("Komponentenanordnung 4:1") = False
Component.IsActive("Mittelpfosten:2") = False
Component.IsActive("Komponentenanordnung 5:1") = False
Component.IsActive("Mittelpfosten:3") = False
Component.IsActive("Komponentenanordnung 6:1") = False
Component.IsActive("Untere Lamelle_2:1") = False
Component.IsActive("Obere Lamelle_2:1") = False
Component.IsActive("Obere Lamelle_4:1") = False
Component.IsActive("Obere Lamelle_3:1") = False
Component.IsActive("Obere Lamelle_5:1") = False
Component.IsActive("Untere Lamelle_5:1") = False

 

End If

 

i miss: Mittelpfosten 3, Obere Lamelle_5,Untere_Lamellen_5 and Komponentenanordnung 6.

 

But i cant find a error in my rule

 

Unbenannt.JPG

0 Likes
Message 8 of 20

CCarreiras
Mentor
Mentor

I will look better in your assembly next week.

 

They are missing files... have you made a "pack and go" to copy the assembly files and linked files.

 

Also.... im seing that you doesnt use a project file (*.ipj) for this iLogic assembly. It will work much better if you create a ipj to manage all links between files and folders, etc.... read about project files and create one.

CCarreiras

EESignature

0 Likes
Message 9 of 20

Anonymous
Not applicable

Thank yoou.

 

shuld i send you the file again?

 

How can i create a project file? just save it in my folder?

0 Likes
Message 10 of 20

Anonymous
Not applicable

Hello CarlossC

 

I have make a project file in my folder like here:

 

Unbenannt.JPG

 

But still id doesent work. Whant can i do to make the case 3 active?

 

Thanks!

Aleksandar

0 Likes
Message 11 of 20

CCarreiras
Mentor
Mentor

Hi!

 

 

I can't do much to help you... simply i can't test...

It's missing parts and there's some errors in the assembly (maybe due these missing files).

 

You have to save your assembly as "Pack and go" and post here.

 

If you place here the complete assembly, will be glad to help.

 

1.png2.png

CCarreiras

EESignature

0 Likes
Message 12 of 20

Anonymous
Not applicable

Hi CarlossC

 

Here you have the link for downloading the file (in folder Workgrups, NotInProject):

 

https://mega.nz/#!q98j1YTR!L3xHlWNCzJHdKnBc8JSyZO4WOR_q-HRAjlctUbSAu_U

 

I use the option pack and go.

0 Likes
Message 13 of 20

CCarreiras
Mentor
Mentor
Accepted solution

SyntaxEditor Code Snippet

Select Case Mittelpfosten_vorhanden
    Case 0
        Component.IsActive("Mittelpfosten:1") = False
        Component.IsActive("Mittelpfosten:2") = False
        Component.IsActive("Mittelpfosten:3") = False
    Case 1
        Component.IsActive("Mittelpfosten:1") = True
        Component.IsActive("Mittelpfosten:2") = False
        Component.IsActive("Mittelpfosten:3") = False
    Case 2
        Component.IsActive("Mittelpfosten:1") = True
        Component.IsActive("Mittelpfosten:2") = True
        Component.IsActive("Mittelpfosten:3") = False
    Case 3
        Component.IsActive("Mittelpfosten:1") = True
        Component.IsActive("Mittelpfosten:2") = True
        Component.IsActive("Mittelpfosten:3") = True
End Select
CCarreiras

EESignature

0 Likes
Message 14 of 20

CCarreiras
Mentor
Mentor
Accepted solution

I think the problem isn't the  rule, but in the parameter.

 

If you change the parameter, the rule works well.

 

 

CCarreiras

EESignature

0 Likes
Message 15 of 20

Anonymous
Not applicable

Good thank you i will use your rule to supress my parts. Thank you for the video.

 

But how can i mak a user parameter and edit it from excel?

 

Shold i make a new user parameter, to linked it in my rule?

0 Likes
Message 16 of 20

Anonymous
Not applicable

Here is it now. It works for case 2 3 4 but in case 1 he doesent supress:

 

Select Case Probe_2
Case 2
Component.IsActive("Mittelpfosten:1") = 0
Component.IsActive("Mittelpfosten:2") = 0
Component.IsActive("Mittelpfosten:3") = 0
Component.IsActive("Komponentenanordnung 4:1") = 0
Component.IsActive("Komponentenanordnung 5:1") = 0
Component.IsActive("Komponentenanordnung 6:1") = 0
Component.IsActive("Untere Lamelle_2:1") = 0
Component.IsActive("Obere Lamelle_2:1") = 0
Component.IsActive("Obere Lamelle_4:1") = 0
Component.IsActive("Obere Lamelle_3:1") = 0
Component.IsActive("Obere Lamelle_5:1") = 0
Component.IsActive("Untere Lamelle_5:1") = 0

 

Probe_2 is a new user parameter that i linked with my excel (case 2 is the frist case, when the Mitelpfosten supress is)

Unbenannt.JPG

 

I dont know why he doesent supress, but all components are "Falase"

0 Likes
Message 17 of 20

CCarreiras
Mentor
Mentor

 

  • In the assembly you sent is  missing the part i told you before, again. I guess is doing some rule that is calling that unisistent part.
  • This rule you're speaking now... i can't find it... i can't test it
  • All that "side" rules: convert to pdf, email stuff, etc etc.... you must have to do this after you have a stable cad model (your model will start to be a mess, and you will loose tracking what is goin wrong and why). """You started the configuration starting the house from the roof"""

I think your main problems are in the excel parameters, some wrong links, because the rules work if you change the parameter mannually.

 

Have you try changing the parameters in a form, instead using excel?

CCarreiras

EESignature

0 Likes
Message 18 of 20

Anonymous
Not applicable

hello aganin Carloss

 

Yes i tried iand i bekomme this yellow fields:

 

Unbenannt.JPG

 

Do yoi know what that means?

0 Likes
Message 19 of 20

CCarreiras
Mentor
Mentor

NO i don't know what it is... but can't be a good thing 🙂

 

Post the files....

CCarreiras

EESignature

0 Likes
Message 20 of 20

Anonymous
Not applicable

My mega clodu doesent work yet.

 

Can you send me a prvivate e mail please?

0 Likes