I'm trying to achieve serial communication in 3ds max by accessing activex control, mscomm
Below is my script:
utility ActiveXTEST "ActiveX Test"
(
rollout mscommtest "MSCOMM TEST" width:200 height:300
(
ActiveXControl MSComm1 "MSCOMMLib.MSComm.1" \
pos:[3,5] width: 156 height: 191
button btn1 "Connect COM 1" pos:[24,131] width:110 height:27
on btn1 pressed do
(
MSComm1.Settings = "2400,N,8,1"
MSComm1.CommPort = 1
MSComm1.PortOpen = True
)
slider sl1 "Servo 1" type:#integer orient:#vertical ticks:0 range:[0,255,128]
on sl1 changed value do
(
MSComm1.Output = "255"
MSComm1.Output = "0"
MSComm1.Output = "value"
)
)
on ActiveXTEST open do
(
addRollout mscommtest
)
)
i can access to com port but when i move the slider, 2 messages box appears:
-(maxscript rollout handler exception):
Runtime error: cannot set the property, .output
-(maxscript)
this property needs an index, use setIndexedProperty #output
Can anyone help me with this? i donno why this happen and i donno how to use the "setIndexedProperty #output" function...
lutteral · 2010-06-22
Anubis · 2010-06-22