Variable Automation
Variable Automation
(OP)
Hi all,
I am hoping that someone will be able to point me in the right direction with a problem I have with varibles.
What I want to do is to suppress two features if the size of a hole is over a specific size.
I have written a .bas file which contains the following:
'===========================================================================
Sub VarSelect(ByVal ip As Double, ByRef op1 As Double, ByRef op2 As Double)
If (ip >= 6) Then
op1 = 1
op2 = 1
Else
op1 = 0
op2 = 0
End If
End Sub
'===========================================================================
When I try to add the the code to into the variables table I get an error.
I tried using three variables that are just TEST, A and B so that none of the geometry was being driven and I still get the same error.
The error says:
"Variable "test" is driven and cannot be used within related geometry to evaluate driving variable "test""
It appears to be saying that the variable TEST is being driven and cannot be used but I am not trying to drive TEST I am trying to use its value to set variables A & B!!
If someone can point me in the direction of why this is happening, I would very much appreciate it.
Thanks
Kind regards
I am hoping that someone will be able to point me in the right direction with a problem I have with varibles.
What I want to do is to suppress two features if the size of a hole is over a specific size.
I have written a .bas file which contains the following:
'===========================================================================
Sub VarSelect(ByVal ip As Double, ByRef op1 As Double, ByRef op2 As Double)
If (ip >= 6) Then
op1 = 1
op2 = 1
Else
op1 = 0
op2 = 0
End If
End Sub
'===========================================================================
When I try to add the the code to into the variables table I get an error.
I tried using three variables that are just TEST, A and B so that none of the geometry was being driven and I still get the same error.
The error says:
"Variable "test" is driven and cannot be used within related geometry to evaluate driving variable "test""
It appears to be saying that the variable TEST is being driven and cannot be used but I am not trying to drive TEST I am trying to use its value to set variables A & B!!
If someone can point me in the direction of why this is happening, I would very much appreciate it.
Thanks
Kind regards





RE: Variable Automation
you can do it without an external .bas module, see attached
Sample (V19). If that's what you're trying to achive
L1/L2 may be used with any feature here I've used it to
control the holes
dy
RE: Variable Automation
your function must be used as formula for the suppresion
variables passed in as argument 2 or argument 3
The first argument must be the one to check against.
You need only to set it as formula for 1 suppression variable
SE will automatically set it for the other as well (that's
because the output (arg2/arg3) will name them)
Remember: your Formula does not directly return a value!
See image
dy
RE: Variable Automation
I have the included a image of the error. I tried to set the variable exactly as you described which is when I got the error.
It should hopefully be a little easier to see what I am describing!!
Kind regards
RE: Variable Automation
tested most if not all variations -- no problem
What about a different name instead of 'test' say 'foo'?
dy
RE: Variable Automation
The .bas filename had a $ in it and didn't like that.
I ended up in the end typing it in by hand rather than use the wizard.
Thanks for your help, it has been much appreciated.
Kind regards