Feature is active with letter

Feature is active with letter

jostroopers
Collaborator Collaborator
291 Views
3 Replies
Message 1 of 4

Feature is active with letter

jostroopers
Collaborator
Collaborator

I have an excel sheet which is linked to my model.
In one of the columns it says 'Opties'.

This is a combination of letters.
This can be multiple letter combinations linked to a feature.
Now I have processed each option into a case.
However, is it possible in iLogic to search in the letter code which letter is present and then turn the feature on and/or off, False or True.

Example:

F = vast , then all options are off.(false)

Hijsconstr = h
Zonwering = b
Regensensor = r
Windsensor = w
Inbraak = i
Kabel zonwering = k

I now have several opties: F, Fh, Fhi, Fhik, Fhikbrw, Fkbrw

and 30 combinations more.

Current code:

Select Case Opties
	Case "F"
		Feature.IsActive("13360-01", "Hijsconstr") = False
		Feature.IsActive("13360-02", "Hijsconstr") = False
		Feature.IsActive("13360-03", "Zonwering") = False
		Feature.IsActive("13360-04", "Zonwering") = False
		Feature.IsActive("13360-02", "Regensensor") = False
		Feature.IsActive("14560-01", "InbraakEind") = False
		Feature.IsActive("14560-01", "InbraakLi") = False
		Feature.IsActive("14560-01", "InbraakRe") = False
		Feature.IsActive("14560-01", "InbraakKop") = False
		Feature.IsActive("14560-02", "InbraakEind") = False
		Feature.IsActive("14560-02", "InbraakLi") = False
		Feature.IsActive("14560-02", "InbraakRe") = False
		Feature.IsActive("14560-02", "InbraakKop") = False
		Feature.IsActive("14560-03", "InbraakLi") = False
		Feature.IsActive("14560-03", "InbraakRe") = False		
		Feature.IsActive("14560-04", "InbraakLi") = False
		Feature.IsActive("14560-04", "InbraakRe") = False
		Feature.IsActive("14561-04", "KabelZonwering") = False
		Feature.IsActive("13362-04", "KabelZonwering") = False
Case "Fkbrw"
		Feature.IsActive("13360-01", "Hijsconstr") = False
		Feature.IsActive("13360-02", "Hijsconstr") = False
		Feature.IsActive("13360-03", "Zonwering") = True
		Feature.IsActive("13360-04", "Zonwering") = True
		Feature.IsActive("13360-02", "Regensensor") = True
		Feature.IsActive("14560-01", "InbraakEind") = False
		Feature.IsActive("14560-01", "InbraakLi") = False
		Feature.IsActive("14560-01", "InbraakRe") = False
		Feature.IsActive("14560-01", "InbraakKop") = False
		Feature.IsActive("14560-02", "InbraakEind") = False
		Feature.IsActive("14560-02", "InbraakLi") = False
		Feature.IsActive("14560-02", "InbraakRe") = False
		Feature.IsActive("14560-02", "InbraakKop") = False
		Feature.IsActive("14560-03", "InbraakLi") = False
		Feature.IsActive("14560-03", "InbraakRe") = False		
		Feature.IsActive("14560-04", "InbraakLi") = False
		Feature.IsActive("14560-04", "InbraakRe") = False
		Feature.IsActive("14561-04", "KabelZonwering") = True
		Feature.IsActive("13362-04", "KabelZonwering") = True
 

 

 

Mvg Jos
Youre drawings are as good as the symbols that compleet them.....
0 Likes
292 Views
3 Replies
Replies (3)
Message 2 of 4

JelteDeJong
Mentor
Mentor

You could try something like this:

Dim inputString = "Fhik"

'I use inputString.ToUpper() to make sure I always compare with capital letters.
If inputString.ToUpper().Contains("F") Then
    MsgBox("String contains F")
    ' set your features
    'Feature.IsActive("13360-01", "Hijsconstr") = False
    'Feature.IsActive("13360-02", "Hijsconstr") = False
    'Feature.IsActive("13360-03", "Zonwering") = False
    'Feature.IsActive("13360-04", "Zonwering") = False
    'Feature.IsActive("13360-02", "Regensensor") = False
    'Feature.IsActive("14560-01", "InbraakEind") = False
    'Feature.IsActive("14560-01", "InbraakLi") = False
    'Feature.IsActive("14560-01", "InbraakRe") = False
    'Feature.IsActive("14560-01", "InbraakKop") = False
    'Feature.IsActive("14560-02", "InbraakEind") = False
    'Feature.IsActive("14560-02", "InbraakLi") = False
    'Feature.IsActive("14560-02", "InbraakRe") = False
    'Feature.IsActive("14560-02", "InbraakKop") = False
    'Feature.IsActive("14560-03", "InbraakLi") = False
    'Feature.IsActive("14560-03", "InbraakRe") = False
    'Feature.IsActive("14560-04", "InbraakLi") = False
    'Feature.IsActive("14560-04", "InbraakRe") = False
    'Feature.IsActive("14561-04", "KabelZonwering") = False
    'Feature.IsActive("13362-04", "KabelZonwering") = False
End If
If inputString.ToUpper().Contains("H") Then
    MsgBox("String contains H")
    ' set your features for Hijsconstr 
End If
If inputString.ToUpper().Contains("R") Then
    MsgBox("String contains R")
    ' set your features for Hijsconstr 
End If

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

0 Likes
Message 3 of 4

jostroopers
Collaborator
Collaborator

@JelteDeJong 

Thanks for your response.

However this is not what I mean.

I have a parameter 'Opties' which is filled from excel.

Now that letter combination should be placed in the rule.

Then the code should check which letters are present and set the corresponding feature to True.

If the letter is not present the feature should remain or be set to Falls.

And the msgbox is not what i want because i have to click it everytime a letter is present.

 

jostroopers_0-1660065730882.png

 

Mvg Jos
Youre drawings are as good as the symbols that compleet them.....
0 Likes
Message 4 of 4

JelteDeJong
Mentor
Mentor

If there is no code needed for filling the "Opties" (I have a parameter 'Opties' which is filled from excel.) then you can just use it in the rule. like this:

 

Dim inputString = Opties

'I use inputString.ToUpper() to make sure I always compare with capital letters.
If inputString.ToUpper().Contains("F") Then
    ' set your features
    'Feature.IsActive("13360-01", "Hijsconstr") = False
    'Feature.IsActive("13360-02", "Hijsconstr") = False
    'Feature.IsActive("13360-03", "Zonwering") = False
...

 

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

0 Likes