Forum Discussion
Yo Stefanie!
The error "Type mismatch: 'TestObject.WaitChild" it is because the result of .WaitChild() its an object not true/false value (boolean)
what you can do is to add .Exists in Your If condition to properly check the state of the object.
Example:
if(Aliases.Cube.CubeTransitionBox.WaitChild("WLbl_ValidationImage", 50000).Exists) { // code }
The result from .Exist method is a boolean value.
Hope this will help Yoy.
Hi Wamboo,
thanks for helping!
you're right! I re-edit the script but the still got an error
Sub Test39
TestObject=Aliases.Inventor.AInventor.Pane_ModelBrowser.lst_Assembly
If TestObject.WaitChild(lstbox_LandingSurface,15000).Exists Then
log.Message "the model browser is ready"
call Aliases.Inventor.AInventor.Pane_ModelBrowser.lst_Assembly.txtBlock_LandingSurface.ClickR(30,10) 'choose landing surface node and edit feature
Else
End if
End Sub
so I adjusted again:
Sub Test36
If Aliases.Inventor.AInventor.Pane_ModelBrowser.lst_Assembly.WaitChild(Aliases.Inventor.AInventor.Pane_ModelBrowser.lst_Assembly.lstbox_LandingSurface,15000).Exists Then
log.Message "the model browser is ready"
call Aliases.Inventor.AInventor.Pane_ModelBrowser.lst_Assembly.txtBlock_LandingSurface.ClickR(30,10) 'choose landing surface node and edit feature
Else
End if
End Sub
then tried this again:
Sub Test37
If Aliases.Inventor.AInventor.Pane_ModelBrowser.lst_Assembly.WaitChild(lstbox_LandingSurface,15000).Exists Then
log.Message "the model browser is ready"
call Aliases.Inventor.AInventor.Pane_ModelBrowser.lst_Assembly.txtBlock_LandingSurface.ClickR(30,10) 'choose landing surface node and edit feature
Else
End if
End Sub
- Wamboo5 years agoCommunity Hero
Can you try to use the method name, .WaitAliasChild instead of .WaitChild ?
check this topic for more information: