Script
You can set a script in an object.
If you set a script in the object, the behavior of the object will be changed like the following.
Script must be described using UTF-8 character codes.
You must describe the following functions to control the object.
OnSelectObject(session, tool, objectId)
If you set a script in the object, the behavior of the object will be changed like the following.
- When you double-click the object, the script-tool will start and the tool hold the object.
- Behaviors of editting are controled by the script program.
- Interlocking movement is controled by the script program.
Script must be described using UTF-8 character codes.
You must describe the following functions to control the object.
OnSelectObject(session, tool, objectId)
Called when the target object is selected by the script-tool.
Parameters
Parameters
session
Session class object.
The session is created when just before OnSelectObject is called and kept until end of OnUnselectObject calling.
The session is created when just before OnSelectObject is called and kept until end of OnUnselectObject calling.
tool
ToolScriptEdit class object.
Script-tool.
Script-tool.
objectId
ID of ObjDynabase class object.
It's the ID of the selected object.
It's the ID of the selected object.
Returns
Nothing
OnUnselectObject(session, tool, objectId)
Called when the target object is released from the scrilt-tool.
Parameters
Parameters
session
Session class object.
The session is created when just before OnSelectObject is called and kept until end of OnUnselectObject calling.
The session is created when just before OnSelectObject is called and kept until end of OnUnselectObject calling.
tool
ToolScriptEdit class object. Script-tool.
objectId
ID of ObjDynabase class object.
It's the ID of the selected object.
It's the ID of the selected object.
Returns
Nothing
OnStartHandleMoving(session, tool, handleId, objectId)
Called when the dragging of the handle starts.
Parameters
Parameters
session
Session class object.
The session is created when just before OnSelectObject is called and kept until end of OnUnselectObject calling.
The session is created when just before OnSelectObject is called and kept until end of OnUnselectObject calling.
tool
ToolScriptEdit class object. Script-tool.
handleId
Integer value. ID of the dragged handle.
objectId
ID of ObjDynabase class object.
It's the ID of the selected object.
It's the ID of the selected object.
Returns
Nothing
OnHandleMoving(session, tool, handleId, objectId)
Called while user is dragging the handle.
Parameters
Parameters
session
Session class object.
The session is created when just before OnSelectObject is called and kept until end of OnUnselectObject calling.
The session is created when just before OnSelectObject is called and kept until end of OnUnselectObject calling.
tool
ToolScriptEdit class object. Script-tool.
handleId
Integer value. ID of the dragged handle.
objectId
ID of ObjDynabase class object.
It's the ID of the selected object.
It's the ID of the selected object.
Returns
Nothing
OnStopHandleMoving(session, tool, handleId, objectId, molipRec, molipHitType)
Called when the dragging of the handle is finished.
Parameters
Parameters
session
Session class object.
The session is created when just before OnSelectObject is called and kept until end of OnUnselectObject calling.
The session is created when just before OnSelectObject is called and kept until end of OnUnselectObject calling.
tool
ToolScriptEdit class object. Script-tool.
handleId
Integer value. ID of the dragged handle.
objectId
ID of ObjDynabase class object.
It's the ID of the selected object.
It's the ID of the selected object.
molipRec
MolipRec structure object.
It exists at the point of the dragging finished.
It exists at the point of the dragging finished.
molipHitType
Integer value.
It's the type how the mouse pointer hits the MOLIP. A member of MolipHitType will be set.
It's the type how the mouse pointer hits the MOLIP. A member of MolipHitType will be set.
Returns
Nothing
ResetHandles(session, tool, objectId)
Called when the control-handles should be created or updated. e.g. When the edit-tool selects this object, etc.
Parameters
Parameters
session
Session class object.
The session is created when just before OnSelectObject is called and kept until end of OnUnselectObject calling.
The session is created when just before OnSelectObject is called and kept until end of OnUnselectObject calling.
tool
ToolScriptEdit class object. Script-tool.
objectId
ID of ObjDynabase class object.
It's the ID of the selected object.
It's the ID of the selected object.
Returns
Nothing
horzMovedMolipArray, vertMovedMolipArray = MoveMolip(session, objectId, molipId, distance)
Called when a MOLIP in the target object is attracted by the inter-MOLIP link.
Parameters
Parameters
session
Session class object.
The session is created when just before this function is called and kept until end of this function calling.
The session is created when just before this function is called and kept until end of this function calling.
objectId
ID of ObjDynabase class object.
It's the ID of the target object of moving.
It's the ID of the target object of moving.
molipId
Integer value.
ID of the target MOLIP.
ID of the target MOLIP.
distance
DBLPoint structure object.
Horizontal and vertical distance of the movement.
Horizontal and vertical distance of the movement.
Returns
horzMovedMolipArray
Array of the MOLIP-IDs that are moved horizontally by this function.
vertMovedMolipArray
Array of the MOLIP-IDs that are moved vertically by this function.