Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Variable Automation

Status
Not open for further replies.

THGRMA

Electrical
Joined
Mar 10, 2008
Messages
3
Location
GB
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
 
Hi,

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
 
 http://files.engineering.com/getfile.aspx?folder=1e737f7a-9c80-4f64-884a-8790b1867b4b&file=Func_Bas_Appld.jpg
Hi Don

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
 
 http://files.engineering.com/getfile.aspx?folder=5952eedb-d3a9-42d6-8d8a-8abada61811e&file=Variable.JPG
Found out what the problem was...

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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top