Home Reference Source Repository
public class | source

MagiCAD

Method Summary

Public Methods
public

getCustomizedDxfQueryUrl(product: object, options: object): *

Return DXF query url

public

Return dimension image query url

public

getDpTot(productId: string, systemTypeId: string, qv: number, fanSpeed: number): *

Get pressure drop of curve at specific flow.

public

getImageQueryUrl(options: object): *

Return image query url

public

Return release info of MagiCAD Widget SDK in example Production 2.35.0

public

init(options: object, context: object)

Initialize MagiCAD Widget SDK

public

isLoggedIn(): *

Return information is user logged in.

public

load(options: object): Promise<ProductData>

Load and initialize MagiCAD Cloud Javascript Library

public

renderMagiCADLogo(containerId: string, transparent: boolean)

Render MagiCAD logo to container with specified identified

public

renderMagiCloudLogo(containerId: *, transparent: *)

this method was deprecated. Use renderMagiCADLogo instead

Render MagiCAD logo to container with specified identified

public

renderX3D(options: object, update: boolean): Promise<void>

Renders X3D Image container to given container

public

setDiagram(data: object, options: object)

Set specified diagram and bind click event to given elementId.

public

signin(): Promise<void>

Signin.

public

signout(): Promise<void>

Signout current logged in user

Public Methods

public getCustomizedDxfQueryUrl(product: object, options: object): * source

Return DXF query url

Params:

NameTypeAttributeDescription
product object

The product object returned from MagiCAD.load() function

options object

{ 
     QModelParameters: Optional QModelParameters of model, in format "L=100;D=25;W1=130...",
     Filename: Optional file name and extension for the object to download, in format "example.dxf"
}

Return:

*

DXF url customized with given options. If invalid options object is provided, returns default DXF url, or null if no DXF URL exists

public getDimensionImageQueryUrl(options: object): * source

Return dimension image query url

Params:

NameTypeAttributeDescription
options object

 { 
     QModelId: Optional QModelId of model, 
     QModelParameters: Optional QModelParameters of model, 
     ViewMode: one value of { 0=Rendered, 1=DimensionLabels, 2=DimensionValues },
     ViewPosition: one value of { 0=Default, 1=Front, 2=Right, 3=Left, 4=Top, 5=Bottom, 6=IsometricLeft, 7=IsometricRight } 
 }

Return:

*

Dimension image url

public getDpTot(productId: string, systemTypeId: string, qv: number, fanSpeed: number): * source

Get pressure drop of curve at specific flow.

Params:

NameTypeAttributeDescription
productId string

Product identifier (GUID)

systemTypeId string

Value = {Unknown, AnyFluid, SupplyFluid, ReturnFluid, ColdWater, HotWater, FireHydrant, HotSupplyFluid, Sprinkler, Sewer, AnyAir, SupplyAir, ExtractAir, OutdoorSupply, OutdoorExhau}

qv number

Specified flow

fanSpeed number

Specified Fan Speed

Return:

*

Example {Succeed: true, Value: 27.870676}

public getImageQueryUrl(options: object): * source

Return image query url

Params:

NameTypeAttributeDescription
options object

{ 
     QModelId: Optional QModelId of model, 
     QModelParameters: Optional QModelParameters of model,
     ViewPosition: one value of { 0=Default, 1=Front, 2=Right, 3=Left, 4=Top, 5=Bottom, 6=IsometricLeft, 7=IsometricRight } 
}

Return:

*

Image url

public getReleaseInfo(): string source

Return release info of MagiCAD Widget SDK in example Production 2.35.0

Return:

string

public init(options: object, context: object) source

Initialize MagiCAD Widget SDK

Params:

NameTypeAttributeDescription
options object

Example object:
{ 
 client_id: 'your_client_id', 
 popup_redirect_uri: 'callback file url when using popup signin method'
 redirect_uri: 'callback file url when using redirect signin method' // if given, popup_redirect_uri will be ignored browser redirection is being used instead of popup
 post_logout_redirect_uri: 'callback file url to direct the user to after successful sign-out' 
 enableX3D: true, // default value is true and x3dom library will be loaded
 onLoadUser: function(user) { console.log(user.username); }, // Set event handler to get signed in user if any exists e.g. case when page refreshed
 onSignin: function(user) { console.log(user.username); }, // Set event handler to perform some action on user signin
 onSignout: function() { console.log('user signed out'); }, // Set event handler to perform some action on user signout
 onRenderX3D: function() { console.log('x3d rendered'); }, // Set event handler to perform some action after rendering x3d image
 onGetDpTot function(result) { console.log(result); }, // Set event handler to perform some action with calculation result
 onFindOptimalSpeed: function(result) { console.log(result); } // Set event handler to perform some action with calculation result
}

context object

(optional)

public isLoggedIn(): * source

Return information is user logged in.

Return:

*

boolean value is used logged in

public load(options: object): Promise<ProductData> source

Load and initialize MagiCAD Cloud Javascript Library

Params:

NameTypeAttributeDescription
options object

{ 
     productId: string, 
     articleNumber: string, 
     manufacturerId: string 
 }

where either productId or articleNumber and manufacturerId is defined.

Return:

Promise<ProductData>

Successful response will contain product/variant data

Render MagiCAD logo to container with specified identified

Params:

NameTypeAttributeDescription
containerId string

Container identifier

transparent boolean

Boolean value should transparent image be used

this method was deprecated. Use renderMagiCADLogo instead

Render MagiCAD logo to container with specified identified

Params:

NameTypeAttributeDescription
containerId *

Container identifier

transparent *

Boolean value whether transparent image should be used

public renderX3D(options: object, update: boolean): Promise<void> source

Renders X3D Image container to given container

Params:

NameTypeAttributeDescription
options object

Example:

  {
      x3dUri: location of x3d, 
      containerId: identifier of the container for x3d, 
      imageUri: location of image 
  }

 Optionally, to get 3D view with custom parameters:

 { 
      QModelId: the identifier of the 3D geometry (GUID format), 
      QModelParameters: Optional QModelParameters of model, 
      ViewMode: one value of { 0=Rendered, 1=DimensionLabels, 2=DimensionValues,
      containerId: identifier of the container for x3d, 
      imageUri: location of image 
  }

 In the latter case, x3dUri is not required.
 

update boolean

Update existing container with new image url

Return:

Promise<void>

result as promise

public setDiagram(data: object, options: object) source

Set specified diagram and bind click event to given elementId. Click event will add possible data to given dataElementId

Params:

NameTypeAttributeDescription
data object

Product data

options object

Example:
 { 
     type: diagramType, 
     elementId: 'el', 
     dataElementId: 'dataEl' 
 } 
where diagramType is one of { Ventilation, Heating, Cooling, SupplyAir, ExtractAir, Radiator, Pump }

public signin(): Promise<void> source

Signin. Will open MagiCAD login popup.

Return:

Promise<void>

public signout(): Promise<void> source

Signout current logged in user

Return:

Promise<void>