Dear Berndt,
When I tried to control the MoldFlow by excel, I encountered the following problems. Please help:
1) When I tried to close the MoldFlow manually after running VBScript code by excel, there is error message like following:
"Error Report-Required Value Missing
An Autodesk product failed to send required value of SERIALNUM......."
How to avoid this error?
2) When I used the following script to create injection location, the vector does not work. That is, the direction of injection is not perpendicular to the injection surface selected.
Dim Modeler
Dim BoundaryConditions
Dim Vector
Dim EntList
Dim EntList_1
Dim Vector2
Dim X_injection
Dim Y_injection
Dim Z_injection
Dim X_vector
Dim Y_vector
Dim Z_vector
X_injection = Range("XValueofinjection").Value
Y_injection = Range("YValueofinjection").Value
Z_injection = Range("ZValueofinjection").Value
X_vector = Range("XValueofVector").Value
Y_vector = Range("YValueofVector").Value
Z_vector = Range("ZValueofVector").Value
Set Vector = Synergy.CreateVector()
Set Modeler = Synergy.Modeler()
'Vector.SetXYZ 0, 0, 0
Vector.SetXYZ X_injection, Y_injection, Z_injection
Set EntList = Modeler.CreateNodeByXYZ(Vector)
Set BoundaryConditions = Synergy.BoundaryConditions()
Set Vector2 = Synergy.CreateVector()
'Vector2.SetXYZ 0, 0, 1
Vector2.SetXYZ X_vector, Y_vector, Z_vector
Set EntList_1 = BoundaryConditions.CreateNDBC(EntList, Vector, 40000, Nothing)
3) When I used the CustomReport.vbs to generate the report in excel, there are a number of errors reported. One of the error is as following:
"Object required"
The function is as following, while I do not know how to define the "WScript " object.
Function IsSilentArgument()
' Deterimine if the -silent option is specified on the command line
IsSilentArgument = False
Dim Args, i
Set Args = WScript.Arguments
For i = 0 To Args.Count - 1
If Args(i) = "-silent" Then
IsSilentArgument = True
End If
Next
End Function
Please help.
Thanks