PDA

View Full Version : help _ external webBrowser tool


EGGer
03-04-2007, 06:49 AM
HI all:

I am so puzzled that how can I set commandPort for VBScript in html ? do I must use "commandportDefault" to execute commands or receive result from maya?

Is there any method to define a new port ? Thank you so much !!!

Sub getR( args )
Dim MEL
Set MEL = CreateObject("Maya.CommandEngine.MEL")
On Error Resume Next
MEL.Connect()
If Not MEL.Connected Then
MsgBox "Error: " & Err.Description
Err.Clear
Exit Sub
End If
MEL.Execute(args)
Dim Result
If VarType(MEL.Result) >= vbArray Then
resStr = "{ " & Join(MEL.Result, ", ") & " }"
Else
resStr = MEL.Result
End If

MEL.Disconnect()
End Sub

butCherHeLL
03-04-2007, 09:00 PM
I think you are attempting to create an ole object in vbscript in as a html script.

unfortunately maya does not have an interface objects to mel command

use a client tcpip protocol class in a compiler type of language.

I dont know VB but like that:

dim iTcpip internetconnection;

itciptip.port=defaultPort;
itcpip.ip="localhost";

if (itcpip.connect) itcpip.sendtext("hello moon");

itcpip.disconnect;


I don't think so, a module for command engine interface to VBinterpreter in html support defined.

EGGer
03-05-2007, 06:40 AM
I think you are attempting to create an ole object in vbscript in as a html script.

unfortunately maya does not have an interface objects to mel command

use a client tcpip protocol class in a compiler type of language.

I dont know VB but like that:

dim iTcpip internetconnection;

itciptip.port=defaultPort;
itcpip.ip="localhost";

if (itcpip.connect) itcpip.sendtext("hello moon");

itcpip.disconnect;


I don't think so, a module for command engine interface to VBinterpreter in html support defined.

butCherHeLL:

Thank you for doing me a favor!

The best way is finding an offical document which is about how to setting connection between VBScript and Maya. I used google to search ,but nothing can be found.

Now, I just can send commands through default commandPort.

Thank you all the same !!!

butCherHeLL
03-05-2007, 09:51 AM
dont know howto retrieve defaultPort number

but I am opening my port manually in maya by executing this line

commandPort -name "127.0.0.1:2325"




<html>
<body>
<SCRIPT LANGUAGE="VBS">
<!--
function sendhello()
set Socket =CreateObject("Socket.TCP")
Socket.TimeOut = 10000
Socket.Host = "127.0.0.1:2325"
Socket.Open()
Socket.SendText("print hello moon ");
socket.WaitForDisconnect()
socket.Close()
end function

sendhello()
-->
</SCRIPT>
</body>
</html>


that should work in serverside.

please correct me where I am wrong.

my first VBCode. : D

EGGer
03-06-2007, 08:49 AM
dont know howto retrieve defaultPort number

but I am opening my port manually in maya by executing this line

commandPort -name "127.0.0.1:2325"




<html>
<body>
<SCRIPT LANGUAGE="VBS">
<!--
function sendhello()
set Socket =CreateObject("Socket.TCP")
Socket.TimeOut = 10000
Socket.Host = "127.0.0.1:2325"
Socket.Open()
Socket.SendText("print hello moon ");
socket.WaitForDisconnect()
socket.Close()
end function

sendhello()
-->
</SCRIPT>
</body>
</html>


that should work in serverside.

please correct me where I am wrong.

my first VBCode. : D


Great! Thank you so much !Your method is correct ... VB to Maya . The port should use this < Socket.PortName="****" > to reset.


butCherHeLL ! That's very kind of you! thank you

CGTalk Moderation
03-06-2007, 08:49 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.