A Path equipment provides a mechanism to move an object along a defined path. This is intended for the simulation of Automatically Guided Vehicles (AGV).
Name | Type | Description |
LineWidth | Number | Gets/Sets the Width of the Line in the units chosen when the project was created (metres or feet) |
Color | String | New in V7.0. Gets/Sets the name of the color of the equipment |
Visible | Boolean | New in V7.0. Gets/Sets the visibility of the equipment |
void MoveAlongSection(sectionId: integer, obj: object, speed: number, acceleration: number, deceleration: number, backward: boolean, offset: number)
Called to move an object along a section.
Name | Type | Description |
sectionId | Integer | Id of the section. One based |
object | Object | Object to be moved on the section |
speed | Number | Max speed in the units chosen when the project was created (metres or feet) |
acceleration | Number | Acceleration from 0 to max speed |
deceleration | Number | Deceleration from max speed to 0 |
backward | Boolean | Boolean to indicate if running backward |
offset | Number | (Not used, Reserved for future development) |
void MoveAlongSectionWithDistance(sectionId: integer, obj: object, speed: number, acceleration: number, deceleration: number, backward: boolean, distance : double, callback : function)
Called to move an object along section for a certain distance and callback the function once reached the distance.
Name | Type | Description |
sectionId | Integer | Id of the section. One based |
object | Object | Object to be moved on the section |
speed | Number | Max speed in the units chosen when the project was created (metres or feet) |
acceleration | Number | Acceleration from 0 to max speed |
deceleration | Number | Deceleration from max speed to 0 |
backward | Boolean | Boolean to indicate if running backward |
distance | Double | Specific distance to move the object along path |
callback | Function | Callback function to be call (null if no callback) |
var path1; var path2; var ob1; var ob2; function OnSimulationStart() { LogDebug("OnSimulationStart called"); ob1 = GetComponentByNameAndType ('BasicShape1', "Basic Shape"); ob2 = GetComponentByNameAndType ('BasicShape2', "Basic Shape"); path1 = GetComponentByNameAndType ('Path1', "Path"); path2 = GetComponentByNameAndType ('Path2', "Path"); path1.MoveAlongSectionWithDistance(1, ob1, 10.0, 0.0, 0.0, false,10.0, Noop); path2.MoveAlongSectionWithDistance(1, ob2, 5.0, 0.0, 0.0, true,7.0, Noop); } function Noop(sender,sectionID,object,backward) { LogDebug("Noop: " + index); LogDebug("X: " + object.X + " Y: " + object.Y + " Z: " + object.Z); }
var path1; var ob1; function OnSimulationStart() { LogDebug("OnSimulationStart called"); ob1 = GetComponentByNameAndType ('BasicShape1', "Basic Shape"); path1 = GetComponentByNameAndType ('Path1', "Path"); path1.MoveAlongSectionWithDistance(1, ob1, 10.0, 0.0, 0.0, false,10.0, null); }
OnObjectAtSectionEnd
Invoked when an object reaches the end of a section
Callback Signature
void xxxxxxxxxxxxxxxxx (sender: object, sectionId: number, obj: object, isSectionStart: boolean);
Name | Type | Description |
sender | Object | The object associated with the event |
sectionId | Number | Id of the section. One based |
obj | Object | The object that is at section's end |
isSectionStart | Boolean | If object is running backward, this boolean will be true when the object reaches the end. |