×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Variable Automation

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

RE: Variable Automation

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

RE: Variable Automation

(OP)
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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources