I want different features on and off with iLogic.
I have a text parameter with a choice menu of 1,2, and 3
This I want some features on and off.
If I pass the parameter I get a message: No feature found with the name.
I think you want to supress the parts. There are no features in that Assembly - thus the error.
Create a new level of detail, then run this
If AantalKoppelingen = 1 Then Component.IsActive("KlemHoekstuk") = True Component.IsActive("Buis") = False Component.IsActive("KlemTStuk") = False Component.IsActive("Buis:1") = False Component.IsActive("KlemHoekstuk:1") = False ElseIf AantalKoppelingen = 2 Then Component.IsActive("KlemHoekstuk") = True Component.IsActive("Buis") = True Component.IsActive("KlemTStuk") = True Component.IsActive("Buis:1") = False Component.IsActive("KlemHoekstuk:1") = False End If iLogicVb.UpdateWhenDone = True
If you are planning on doing more than 2-3 IF statements you should consider CASE Statements - much faster.
Select Case AantalKoppelingen Case 1: Component.IsActive("KlemHoekstuk") = True Component.IsActive("Buis") = False Component.IsActive("KlemTStuk") = False Component.IsActive("Buis:1") = False Component.IsActive("KlemHoekstuk:1") = False Case 2: Component.IsActive("KlemHoekstuk") = True Component.IsActive("Buis") = True Component.IsActive("KlemTStuk") = True Component.IsActive("Buis:1") = False Component.IsActive("KlemHoekstuk:1") = False Case 3: Component.IsActive("KlemHoekstuk") = False Component.IsActive("Buis") = False Component.IsActive("KlemTStuk") = True Component.IsActive("Buis:1") = False Component.IsActive("KlemHoekstuk:1") = False Case 4: Component.IsActive("KlemHoekstuk") = True Component.IsActive("Buis") = True Component.IsActive("KlemTStuk") = True Component.IsActive("Buis:1") = True Component.IsActive("KlemHoekstuk:1") = False End Select iLogicVb.UpdateWhenDone = True
Thanks Jonathan
The Case statement works.
But now i go a step further.
I have more types of couplings on one place and i want to control them to.
The parameter 'TypeAftakking' controls the type and the parameter 'aantalKoppelingen' controls the number of couplings.
The number of couplings go's good but when i change the TypeAftakking i get an error.
I have to make 10 couplings and 9 pipes in between.
In the TypeAftakking wil be at least 20 couplings.
I think that i can't use same case numbers in both rules.
It's a matter of setting both parts to False first, you can do this manually, but also through the code.
Component.IsActive("K1-01:1") = False Component.IsActive("K7-01:1") = False Select Case TypeAftakking Case 1: Component.IsActive("K1-01:1") = True Component.IsActive("K7-01:1") = False Case 7: Component.IsActive("K1-01:1") = False Component.IsActive("K7-01:1") = True End Select iLogicVb.UpdateWhenDone = True
When i want to change TypeAftakking i get an error.
I wondering if i have to make a level of detail because in the code you turn of the components first.
But i put the level of detail to master and then i get the message that there is no level of detail.
Hi,
Could you list the code how you changed TypeAftakking? It will be of help for the peers to diagnose. thank you.
I use two types of code.
The first to select the type of Aftakking.
And the second to select the numbers for AantalKoppelingen
Select Case TypeAftakking
Case 1: Component.IsActive("K1-01:1") = True
Component.IsActive("K7-01:1") = False
Case 7: Component.IsActive("K1-01:1") = False
Component.IsActive("K7-01:1") = True
End Select
iLogicVb.UpdateWhenDone = True
Select Case AantalKoppelingen
Case 1: Component.IsActive("KoppelingT1-01:1") = True
Component.IsActive("L1-01:1") = False
Component.IsActive("KoppelingT2-01:1") = False
Case 2: Component.IsActive("KoppelingT1-01:1") = True
Component.IsActive("L1-01:1") = True
Component.IsActive("KoppelingT2-01:1") = True
End Select
iLogicVb.UpdateWhenDone = True
Must I then make for every situation a different level of detail?
My starting point is 10 couplings and 9 pieces of pipe .
Now it may happen that I would turn off 1 or more couplings with pipe .
In the coupling can be also variations of different types.
work great if you dont want to change your choice, when is not active because de first choice the rule dont work, it's possible to remake de component active???
Thanks for your help!