Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

get user input 1

Status
Not open for further replies.

Zoes

Mechanical
Sep 30, 2011
46
GB
Code:

Dim initial As String = "enter name"

Public Sub dialogShown_cb()
Try
string0.GetProperties.SetString("Value", initial)
string01.GetProperties.SetString("Value", "")
End Try
End Sub

Public Function apply_cb() As Integer
Try
Dim UserInputString As String
UserInputString = string0.GetProperties.GetString(initial)
string01.GetProperties.SetString("Value", UserInputString)
End Try
End Function

Error: Invalid property name for the block... .GetString(String propertyName)at appy_cb()...

Anybody knows what's wrong with the above code? I'm guessing is something simple but I can't see what it is!
 
Replies continue below

Recommended for you

Instead of in the apply_cb function use the update_cb function which needs to be

Public Function update_cb(ByVal block As NXOpen.BlockStyler.UIBlock) As Integer
Try
If block Is string0 Then
Dim UserInputString As String
UserInputString = string0.GetProperties.GetString("Value")
string01.GetProperties.SetString("Value", UserInputString)
string0.GetProperties.SetString("Value", "Enter Name")
ElseIf block Is string01 Then
'---- Enter your code here -----
End If
Catch ex As Exception

End Try
update_cb = 0
End Function

Hope this helps

Frank Swinkels
 
Thank you!

Can I further ask if you know the attribute for making the string visible/hidden?

I was looking to find the state of the string and change it.. but nothing similar appears in the library.
 
There is a show method which for say string0 is

string01.GetProperties.SetLogical("Show", False)

This would hide all string01. Simply use

string01.GetProperties.SetLogical("Show", True)

to again show it.

Is this what you were looking for?

Frank Swinkels
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top