walkinside-js¶
Classes¶
Coordinate¶
Represents a 3D coordinate.
Constructors¶
Constructor¶
new Coordinate(
x,y,z):Coordinate
Parameters¶
| Parameter | Type |
|---|---|
x | number |
y | number |
z | number |
Returns¶
Properties¶
| Property | Modifier | Type |
|---|---|---|
x | public | number |
y | public | number |
z | public | number |
Interfaces¶
BoundingBox¶
Handles bounding box related API calls.
Methods¶
getBoundingBoxAsync()¶
getBoundingBoxAsync(
projectId,branchIds):Promise\<{max:Coordinate;min:Coordinate; }>
Retrieves the bounding box for specified branches within a project.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
projectId | string | The ID of the project containing the branches. |
branchIds | number[] | An array of branch IDs for which to calculate the bounding box. |
Returns¶
Promise\<{ max: Coordinate; min: Coordinate; }>
Resolves with coordinates for the bounding box.
Example¶
project.boundingBox.getBoundingBoxAsync('project123', [1, 2, 3]).then(function(bbox) {
console.log('Bounding box coordinates:', bbox);
}).catch(function(error) {
console.error('Error retrieving bounding box:', error);
});
BranchOperations¶
Handles branch operations related API calls.
Methods¶
colorizeAsync()¶
colorizeAsync(
projectId,branchIds,color):Promise\<string>
Applies a colorize operation to the branches with the specified color.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
projectId | string | The ID of the project containing the branches. |
branchIds | number[] | An array of branch IDs where the color is applied. |
color | string | The color that will be applied to the branches. |
Returns¶
Promise\<string>
Resolves when the colorizing is applied.
Example¶
view.branchOperations.colorizeAsync('project123', [1, 2, 3], 'red').then(function(response) {
console.log('Colorize status:', response);
}).catch(function(error) {
console.error('Error colorizing:', error);
});
hideAsync()¶
hideAsync(
projectId,branchIds):Promise\<string>
Hides the specified branches in the project.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
projectId | string | The ID of the project containing the branches. |
branchIds | number[] | An array of branch IDs to hide. |
Returns¶
Promise\<string>
A Promise that resolves when the branches have been hidden.
Example¶
view.branchOperations.hideAsync('project123', [1, 2, 3]).then(function(response) {
console.log('Hide status:', response);
}).catch(function(error) {
console.error('Error hiding branches:', error);
});
hideEverythingAsync()¶
hideEverythingAsync(
projectId):Promise\<string>
Hides all branches in the project.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
projectId | string | The ID of the project. |
Returns¶
Promise\<string>
A Promise that resolves when all branches have been hidden.
Example¶
view.branchOperations.hideEverythingAsync('project123').then(function(response) {
console.log('Hide everything status:', response);
}).catch(function(error) {
console.error('Error hiding everything:', error);
});
resetAsync()¶
resetAsync(
projectId):Promise\<string>
Resets all branch operations in the project to their default state.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
projectId | string | The ID of the project. |
Returns¶
Promise\<string>
A Promise that resolves when all operations have been reset.
Example¶
view.branchOperations.resetAsync('project123').then(function(response) {
console.log('Reset status:', response);
}).catch(function(error) {
console.error('Error resetting operations:', error);
});
showAsync()¶
showAsync(
projectId,branchIds):Promise\<string>
Shows the specified branches in the project.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
projectId | string | The ID of the project containing the branches. |
branchIds | number[] | An array of branch IDs to show. |
Returns¶
Promise\<string>
A Promise that resolves when the branches have been shown.
Example¶
view.branchOperations.showAsync('project123', [1, 2, 3]).then(function(response) {
console.log('Show status:', response);
}).catch(function(error) {
console.error('Error showing branches:', error);
});
showEverythingAsync()¶
showEverythingAsync(
projectId):Promise\<string>
Shows all branches in the project.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
projectId | string | The ID of the project. |
Returns¶
Promise\<string>
A Promise that resolves when all branches have been shown.
Example¶
view.branchOperations.showEverythingAsync('project123').then(function(response) {
console.log('Show everything status:', response);
}).catch(function(error) {
console.error('Error showing everything:', error);
});
showOnlyAsync()¶
showOnlyAsync(
projectId,branchIds):Promise\<string>
Shows only the specified branches, hiding all others in the project.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
projectId | string | The ID of the project containing the branches. |
branchIds | number[] | An array of branch IDs to show exclusively. |
Returns¶
Promise\<string>
A Promise that resolves when the operation is complete.
Example¶
view.branchOperations.showOnlyAsync('project123', [1, 2, 3]).then(function(response) {
console.log('Show only status:', response);
}).catch(function(error) {
console.error('Error showing only branches:', error);
});
Clipping¶
Handles clipping related API calls.
Methods¶
clipAsync()¶
clipAsync(
min,max):Promise\<{max:Coordinate;min:Coordinate; }>
Applies a clipping box to the project to only display objects within specified coordinates.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
min | Coordinate | The minimum coordinates of the clipping box. |
max | Coordinate | The maximum coordinates of the clipping box. |
Returns¶
Promise\<{ max: Coordinate; min: Coordinate; }>
Resolves when the clipping is applied.
Example¶
project.clipping.clipAsync(
{ x: 0, y: 0, z: 0 },
{ x: 100, y: 100, z: 100 }
).then(function() {
console.log('Clipping applied.');
}).catch(function(error) {
console.error('Error applying clipping:', error);
});
resetClipAsync()¶
resetClipAsync():
Promise\<string>
Removes any applied clipping boxes from the project.
Returns¶
Promise\<string>
Resolves when the clipping has been reset.
Example¶
project.clipping.resetClipAsync().then(function() {
console.log('Clipping reset.');
}).catch(function(error) {
console.error('Error resetting clipping:', error);
});
IApplyColorsAsyncArguments¶
Properties¶
| Property | Type | Description |
|---|---|---|
colorGroups | IColorGroup[] | Groups of colors and the tags they apply to. |
IColorGroup¶
Properties¶
| Property | Type |
|---|---|
color | string |
opacity | number |
tagValues | string[] |
IExecuteCommandArguments¶
Properties¶
| Property | Type | Description |
|---|---|---|
commandInput | string | Additional input for the command (optional). |
commandName | string | The name of the command to execute. |
IExecuteRequestArguments¶
Properties¶
| Property | Type |
|---|---|
requestInput | string |
requestName | string |
ILabelPosition¶
Represents a 3D position for label placement.
Properties¶
| Property | Type |
|---|---|
x | string |
y | string |
z | string |
INotificationArguments¶
Properties¶
| Property | Type | Description |
|---|---|---|
notificationInput | string | Additional input for the notification (optional). |
notificationName | string | The name of the notification to send. |
IProjectArguments¶
Properties¶
| Property | Type |
|---|---|
projectAddress | string |
ISelectAndFlyToArguments¶
Properties¶
| Property | Type | Description |
|---|---|---|
tagValue | string | The tag of the object to select. |
ISettingArguments¶
Copyright © Siemens 2026 ALL RIGHTS RESERVED.
Properties¶
| Property | Type |
|---|---|
settingValue | string |
Label¶
Handles label related API calls.
Methods¶
addLabelAsync()¶
addLabelAsync(
labelText,labelPosition):Promise\<string>
Adds a label to the project at a specific position.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
labelText | string | The text content of the label. |
labelPosition | ILabelPosition | The 3D coordinates where the label should be placed. |
Returns¶
Promise\<string>
A Promise that resolves with the ID of the created label.
Example¶
project.label.addLabelAsync("Important Component", { x: 10, y: 20, z: 30 }).then(function(labelId) {
console.log('Label added with ID:', labelId);
}).catch(function(error) {
console.error('Error adding label:', error);
});
removeLabelAsync()¶
removeLabelAsync(
labelId):Promise\<string>
Removes a label from the project.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
labelId | string | The ID of the label to remove. |
Returns¶
Promise\<string>
A Promise that resolves when the label has been removed.
Example¶
project.label.removeLabelAsync('1234').then(function() {
console.log('Label removed.');
}).catch(function(error) {
console.error('Error removing label:', error);
});
updateLabelPositionAsync()¶
updateLabelPositionAsync(
labelId,labelPosition):Promise\<string>
Updates the position of an existing label.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
labelId | string | The ID of the label to update. |
labelPosition | ILabelPosition | The new 3D coordinates for the label. |
Returns¶
Promise\<string>
A Promise that resolves when the label position has been updated.
Example¶
project.label.updateLabelPositionAsync('1234', { x: 15, y: 25, z: 35 }).then(function() {
console.log('Label position updated.');
}).catch(function(error) {
console.error('Error updating label position:', error);
});
updateLabelTextAsync()¶
updateLabelTextAsync(
labelId,labelText):Promise\<string>
Updates the text of an existing label.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
labelId | string | The ID of the label to update. |
labelText | string | The new text for the label. |
Returns¶
Promise\<string>
A Promise that resolves when the label text has been updated.
Example¶
project.label.updateLabelTextAsync('1234', 'Updated Text').then(function() {
console.log('Label text updated.');
}).catch(function(error) {
console.error('Error updating label text:', error);
});
Measurement¶
Handles measurement related API calls.
Methods¶
onRouteMeasurementCompleted()¶
onRouteMeasurementCompleted(
handler):void
Registers a handler for route measurement completed events.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
handler | (e) => void | The function to call when route measurement is completed. |
Returns¶
void
startRouteMeasurementAsync()¶
startRouteMeasurementAsync():
Promise\<void>
Begins a new route measurement within the project.
Returns¶
Promise\<void>
Resolves when the measurement has started.
Example¶
project.measurement.startRouteMeasurementAsync().then(function() {
console.log('Route measurement started.');
}).catch(function(error) {
console.error('Error starting route measurement:', error);
});
stopRouteMeasurementAsync()¶
stopRouteMeasurementAsync():
Promise\<void>
Stops the current route measurement and returns the results.
Returns¶
Promise\<void>
Resolves when the measurement has stopped.
Example¶
project.measurement.stopRouteMeasurementAsync().then(function(result) {
console.log('Route measurement stopped:', result);
}).catch(function(error) {
console.error('Error stopping route measurement:', error);
});
Project¶
Handles project related API calls.
Properties¶
| Property | Type | Description |
|---|---|---|
boundingBox | BoundingBox | Bounding Box API. |
clipping | Clipping | Clipping API. |
label | Label | Label API. |
measurement | Measurement | Measurement API. |
viewpoint | Viewpoint | Viewpoint API. |
Methods¶
applyColorsAsync()¶
applyColorsAsync(
args):Promise\<void>
Applies coloring to objects based on their tags.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
args | IApplyColorsAsyncArguments | The color arguments. |
Returns¶
Promise\<void>
Resolves when colors have been applied successfully.
Example¶
project.applyColorsAsync({
colorGroups: [
{
color: 'red',
opacity: 1.0,
tagValues: ['pump1', 'pump2']
}
]
}).then(function() {
console.log('Colors applied to specified tags.');
}).catch(function(error) {
console.error('Error applying colors:', error);
});
flyToSelectionAsync()¶
flyToSelectionAsync():
Promise\<void>
Flies the camera to currently selected objects.
Returns¶
Promise\<void>
Resolves when the camera has moved to the selection.
Example¶
project.flyToSelectionAsync().then(function() {
console.log('Camera flown to selected objects.');
}).catch(function(error) {
console.error('Error flying to selection:', error);
});
hideSelectionAsync()¶
hideSelectionAsync():
Promise\<void>
Hides the selected objects.
Returns¶
Promise\<void>
Resolves when selected objects have been hidden.
Example¶
project.hideSelectionAsync().then(function() {
console.log('Selected objects have been hidden.');
}).catch(function(error) {
console.error('Error hiding selected objects:', error);
});
jumpToHome()¶
jumpToHome():
void
Resets the camera to its default home position.
Returns¶
void
Example¶
project.jumpToHome();
console.log('Camera returned to home position.');
on()¶
on(
eventName,handler):void
Parameters¶
| Parameter | Type |
|---|---|
eventName | string |
handler | MessageEventHandler |
Returns¶
void
selectAndFlyToAsync()¶
selectAndFlyToAsync(
args):Promise\<string>
Selects an object by its tag and flies the camera to it.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
args | ISelectAndFlyToArguments | The selection arguments. |
Returns¶
Promise\<string>
Resolves with the result of the selection operation.
Example¶
project.selectAndFlyToAsync('pump1').then(function() {
console.log('Camera flown to selected object.');
}).catch(function(error) {
console.error('Error selecting or flying:', error);
});
showAllAsync()¶
showAllAsync():
Promise\<void>
Makes all objects in the project visible.
Returns¶
Promise\<void>
Resolves when all objects are visible.
Example¶
project.showAllAsync().then(function() {
console.log('All objects are now visible.');
}).catch(function(error) {
console.error('Error showing all objects:', error);
});
showOnlySelectionAsync()¶
showOnlySelectionAsync():
Promise\<void>
Hides all unselected objects, showing only the selected ones.
Returns¶
Promise\<void>
Resolves when only selected objects are visible.
Example¶
project.showOnlySelectionAsync().then(function() {
console.log('Only selected objects are now visible.');
}).catch(function(error) {
console.error('Error showing only selection:', error);
});
unselectAllAsync()¶
unselectAllAsync():
Promise\<void>
Unselects all currently selected objects.
Returns¶
Promise\<void>
Resolves when all selections have been cleared.
Example¶
project.unselectAllAsync().then(function() {
console.log('All selections cleared.');
}).catch(function(error) {
console.error('Error unselecting:', error);
});
Settings¶
Handles settings related API calls.
Methods¶
getCollisionAsync()¶
getCollisionAsync():
Promise\<string>
Checks if collision detection is enabled.
Returns¶
Promise\<string>
Resolves with the current collision setting.
Example¶
settings.getCollisionAsync().then(function(collision) {
console.log('Current collision setting:', collision);
}).catch(function(error) {
console.error('Error getting collision:', error);
});
getGravityAsync()¶
getGravityAsync():
Promise\<string>
Retrieves the current gravity setting.
Returns¶
Promise\<string>
Resolves with the current gravity setting.
Example¶
settings.getGravityAsync().then(function(gravity) {
console.log('Current gravity setting:', gravity);
}).catch(function(error) {
console.error('Error getting gravity:', error);
});
getViewTypeAsync()¶
getViewTypeAsync():
Promise\<string>
Retrieves the current view type (e.g., first person or third person).
Returns¶
Promise\<string>
Resolves with the current view type.
Example¶
settings.getViewTypeAsync().then(function(viewType) {
console.log('Current view type:', viewType);
}).catch(function(error) {
console.error('Error getting view type:', error);
});
onCollisionValueChanged()¶
onCollisionValueChanged(
handler):void
Registers a handler for collision value change events.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
handler | SettingValueChangeEventHandler | The function to call when collision value changes. |
Returns¶
void
onGravityValueChanged()¶
onGravityValueChanged(
handler):void
Registers a handler for gravity value change events.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
handler | SettingValueChangeEventHandler | The function to call when gravity value changes. |
Returns¶
void
onViewTypeValueChanged()¶
onViewTypeValueChanged(
handler):void
Registers a handler for view type value change events.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
handler | SettingValueChangeEventHandler | The function to call when view type value changes. |
Returns¶
void
setCollisionAsync()¶
setCollisionAsync(
isCollision):Promise\<string>
Enables or disables collision detection in the project.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
isCollision | ISettingArguments | The collision setting value. |
Returns¶
Promise\<string>
Resolves when the collision setting has been set.
Example¶
settings.setCollisionAsync(true).then(function() {
console.log('Collision detection enabled.');
}).catch(function(error) {
console.error('Error setting collision:', error);
});
setGravityAsync()¶
setGravityAsync(
isGravity):Promise\<string>
Enables or disables gravity in the project environment.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
isGravity | ISettingArguments | The gravity setting value. |
Returns¶
Promise\<string>
Resolves when the gravity setting has been set.
Example¶
settings.setGravityAsync(true).then(function() {
console.log('Gravity enabled.');
}).catch(function(error) {
console.error('Error setting gravity:', error);
});
setViewTypeAsync()¶
setViewTypeAsync(
viewTypeString):Promise\<string>
Sets the view type for the project.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
viewTypeString | string | The view type to set ('thirdpersonmode' or 'firstpersonmode'). |
Returns¶
Promise\<string>
Resolves when the view type has been set.
Example¶
settings.setViewTypeAsync('thirdpersonmode').then(function() {
console.log('View type set to third person.');
}).catch(function(error) {
console.error('Error setting view type:', error);
});
View¶
Handles view related API calls.
Methods¶
executeCommandAsync()¶
executeCommandAsync(
args):Promise\<void>
Executes a predefined command within the view.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
args | IExecuteCommandArguments | The command arguments. |
Returns¶
Promise\<void>
Resolves when the command has been executed successfully.
Example¶
view.executeCommandAsync({
commandName: 'ResetView',
commandInput: 'optional_input'
}).then(function() {
console.log('Command executed successfully.');
}).catch(function(error) {
console.error('Error executing command:', error);
});
executeRequestAsync()¶
executeRequestAsync(
args):Promise\<any>
Parameters¶
| Parameter | Type |
|---|---|
args | IExecuteRequestArguments |
Returns¶
Promise\<any>
loadProjectAsync()¶
loadProjectAsync(
args):Promise\<Project>
Loads a specified project into the initialized view.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
args | IProjectArguments | The project arguments. |
Returns¶
Promise\<Project>
Resolves with the loaded instance.
Example¶
view.loadProjectAsync({
projectAddress: 'https://example.com/projects/123',
token: 'your_access_token'
}).then(function(project) {
console.info('Project loaded successfully:', project);
}).catch(function(error) {
console.error('Error loading project:', error);
});
notifyAsync()¶
notifyAsync(
args):Promise\<void>
Sends a notification to all listeners within the view.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
args | INotificationArguments | The notification arguments. |
Returns¶
Promise\<void>
Resolves when the notification has been sent successfully.
Example¶
view.notifyAsync({
notificationName: 'UpdateStatus',
notificationInput: 'Updated to new status.'
}).then(function() {
console.log('Notification sent successfully.');
}).catch(function(error) {
console.error('Error sending notification:', error);
});
onBranchSelectionChanged()¶
onBranchSelectionChanged(
handler):void
Subscribes to branch selection change events in the viewer. When branches are selected or deselected in the 3D view, the provided handler will be invoked with details about the selection change action and the affected branch handles.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
handler | (action, branchHandles) => void | Callback function that receives selection change notifications. - action: The type of selection action that occurred (e.g., 'add', 'remove', 'clear') - branchHandles: Array of serialized branch IDs that were affected by the branch selection change |
Returns¶
void
Remarks¶
The format of each branch ID in the branchHandles array is a string "{projectId}/{branchId}"
onNotify()¶
onNotify(
notificationName,notificationHandler):void
Parameters¶
| Parameter | Type |
|---|---|
notificationName | string |
notificationHandler | NotificationHandler |
Returns¶
void
Viewpoint¶
Handles viewpoint related API calls.
Methods¶
jumpToViewpointAsync()¶
jumpToViewpointAsync(
projectId,viewpointId):Promise\<string>
Moves the camera to a specific viewpoint identified by viewpointId.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
projectId | string | The ID of the project containing the viewpoint. |
viewpointId | string | The ID of the viewpoint to jump to. |
Returns¶
Promise\<string>
Resolves when the camera has moved to the viewpoint.
Example¶
project.viewpoint.jumpToViewpointAsync('project123', 'viewpoint456').then(function() {
console.log('Jumped to viewpoint.');
}).catch(function(error) {
console.error('Error jumping to viewpoint:', error);
});
Type Aliases¶
NotificationHandler()¶
NotificationHandler = (
e) =>void
Parameters¶
| Parameter | Type |
|---|---|
e | string |
Returns¶
void
SettingValueChangeEventHandler()¶
SettingValueChangeEventHandler = (
e) =>void
Parameters¶
| Parameter | Type |
|---|---|
e | Settings |
Returns¶
void
Functions¶
createViewAsync()¶
createViewAsync(
viewOptions):Promise\<View>
Initializes a new 3D viewer within a specified container element.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
viewOptions | { backendAddress: string; targetElement?: HTMLElement; targetElementId?: string; } | Configuration options for the view. Should contain backendAddress (server URL), and either targetElementId (DOM element ID) or targetElement (HTMLElement) to host the 3D view. |
viewOptions.backendAddress | string | The address of the backend page. |
viewOptions.targetElement? | HTMLElement | The target HTML element to host the viewer. Optional if targetElementId is provided. |
viewOptions.targetElementId? | string | The ID of the target HTML element to host the viewer. Optional if targetElement is provided. |
Returns¶
Promise\<View>
Resolves with the initialized instance.
Example¶
walkinside.createViewAsync({
backendAddress: 'https://example.com/walkinside-backend',
targetElement: document.getElementById('wi-viewer-container')
}).then(function(view) {
console.info('View created successfully.');
}).catch(function(error) {
console.error('Error creating view:', error);
});