Ilogic form does not work after supressing a subassembly

Ilogic form does not work after supressing a subassembly

Anonymous
Not applicable
449 Views
6 Replies
Message 1 of 7

Ilogic form does not work after supressing a subassembly

Anonymous
Not applicable

I have a form that takes a few multi value parameters.

one parameter is for supressing a subassembly. where the rule sets IsActive to true or false.

Once I change the suppression state, the form exits automatically!!not sure it crashed as the suppression state will be updated.

After that if I run the form and try to select any value from the drop down list or enter a value to any field, the form does not take it.

 

I tried to call a rule that shows the form inside the component suppressing rule, in this case the form will be available and runs perfectly until I click the Done. after this it is the same issue as above.

 

What might be a possible error that I have done?

0 Likes
450 Views
6 Replies
Replies (6)
Message 2 of 7

Owner2229
Advisor
Advisor

Hey, how are you triggering the sub-assy suppressing? Using the general "a parameter changed" event?

It's quite hard to say, as there's many things that could go wrong.

I'll suggest you trying this:

- remove the general trigger for the suppressing rule

- create new parameter (or use the current you have linked to the form, if it's not used for anything else).

Let's assume the parameter is called "SuppressingPara" and it's boolean (true/false) parameter.

- change your suppressing rule, so the start of it looks like this:

 

 

s = SuppressingPara
Dim oState As Boolean = Parameter("SuppressingPara").Value
'Your suppressing code, something like:
Dim oDoc As Document = ThisApplication.ActiveDocument
Dim oCD As ComponentDefinition = oDoc.ComponentDefinition
Dim oOccs As ComponentOccurrences = oCD.Occurrences
Try
Dim oOcc As ComponentOccurrence = oOccs.Item("OccName") If oState Then oOcc.Suppress() Else oOcc.UnSuppress() End If
Catch
End Try

 

 

Consider using "Accept as Solution" / "Kudos" if you find this helpful.
- - - - - - - - - - - - - - -
Regards,
Mike

"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - John F. Woods
0 Likes
Message 3 of 7

Anonymous
Not applicable

I tried the same code of yours,

 

It throws an error saying - Public member 'Value' on type 'Boolean' not found.

The parameter is a true/false one, so why is it happening?

0 Likes
Message 4 of 7

Owner2229
Advisor
Advisor

My fault, try it without the ".Value".

Consider using "Accept as Solution" / "Kudos" if you find this helpful.
- - - - - - - - - - - - - - -
Regards,
Mike

"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - John F. Woods
0 Likes
Message 5 of 7

Anonymous
Not applicable

The code was not returning the component.

so I changed

oOccs.Item("OccName")

to 

 

component.inventorcomponent("OccName")

 Then the code worked perfectly. But the issue remains. after suppress/unsuppress the form exits and does not takeany changes if run later.

0 Likes
Message 6 of 7

Owner2229
Advisor
Advisor

So, I've tested it and it worked for me. So the issue must be somewhere in your form or between your form and the rule.

Maybe some kind of cycling?

Did you remove the original trigger as I suggested?

Consider using "Accept as Solution" / "Kudos" if you find this helpful.
- - - - - - - - - - - - - - -
Regards,
Mike

"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - John F. Woods
0 Likes
Message 7 of 7

Anonymous
Not applicable

 I think I need to start again as it has gone beyond any repair.

Will let you know if it turns out good

0 Likes