Path

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).

 

Properties

NameTypeDescription
LineWidthNumberGets/Sets the Width of the Line in the units chosen when the project was created (metres or feet)
ColorStringNew in V7.0. Gets/Sets the name of the color of the equipment
VisibleBooleanNew in V7.0. Gets/Sets the visibility of the equipment

Functions

void MoveAlongSection(sectionId: integer, obj: object, speed: number, acceleration: number, deceleration: number, backward: boolean, offset: number)

Called to move an object along a section.

NameTypeDescription
sectionIdIntegerId of the section. One based
objectObjectObject to be moved on the section
speedNumberMax speed in the units chosen when the project was created (metres or feet)
accelerationNumberAcceleration from 0 to max speed
decelerationNumberDeceleration from max speed to 0
backwardBooleanBoolean to indicate if running backward
offsetNumber(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.

NameTypeDescription
sectionIdIntegerId of the section. One based
objectObjectObject to be moved on the section
speedNumberMax speed in the units chosen when the project was created (metres or feet)
accelerationNumberAcceleration from 0 to max speed
decelerationNumberDeceleration from max speed to 0
backwardBooleanBoolean to indicate if running backward
distanceDoubleSpecific distance to move the object along path
callbackFunctionCallback function to be call (null if no callback)

Example 1

			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);	
			}

Example 2

			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);
			}
		

Events

OnObjectAtSectionEnd

Invoked when an object reaches the end of a section

Callback Signature

void xxxxxxxxxxxxxxxxx (sender: object, sectionId: number, obj: object, isSectionStart: boolean);

 

NameTypeDescription
senderObjectThe object associated with the event
sectionIdNumberId of the section. One based
objObjectThe object that is at section's end
isSectionStartBooleanIf object is running backward, this boolean will be true when the object reaches the end.

Example Path project

Macro to demonstrate the creation of a path