Miscellaneous


Here are some other useful functions that are available in the console.


Section Builder#

SB.library.getTree#

Description: Fetch the section library tree.

Operation Type: Synchronous

Access: get

Params: null

Sample:

getSectionLibraryTree.js
SB.library.getTree();

Units#

S3D.units.getSystemName#

Description: Gets the name of the current unit system.

Returns: imperial or metric.

Operation Type: Synchronous

Access: get

Params: null

Sample:

getUnitSystem.js
S3D.units.getSystemName();

API#

S3D.API.S3D2API#

Description: Convert an S3D model to SkyCiv's API model format.

Operation Type: Synchronous

Params: S3D.API.S3D2API(structure);

Sample:

convertToApi.js
const structure = S3D.structure.get();
const apiFormattedModel = S3D.API.S3D2API(structure);

S3D.API.API2S3D#

Description: Convert a SkyCiv's API model to the S3D model format.

Operation Type: Synchronous

Params: S3D.API.API2S3D(s3dModel);

Sample:

convertToApi.js
const structure = S3D.structure.get();
const apiFormattedModel = S3D.API.API2S3D(s3dModel);

S3D.API.output.S3D2API#

Description: Convert analysis results from S3D.results.get() / S3D.results.getAll() (which use S3D's internal/legacy results format) into the same analysis results object returned by the S3D.results.get API function. Always convert through this function rather than consuming S3D.results.getAll()'s output directly, so results read the same regardless of whether they came from the S3D UI or the API.

Operation Type: Synchronous

Params: S3D.API.output.S3D2API(resultsObject);

Sample:

convertResultsToApi.js
S3D.results.getAll(true, function () {
const apiFormattedResults = S3D.API.output.S3D2API(S3D.results.getAll(true));
});

Solver#

S3D.solver.isSolved#

Description: Checks whether the currently open model has been solved. S3D.results.get() only returns instantly if this is true โ€” otherwise there are no results to fetch yet.

Returns: true or false.

Operation Type: Synchronous

Access: get

Params: null

Sample:

checkIsSolved.js
if (S3D.solver.isSolved()) {
const results = S3D.API.output.S3D2API(S3D.results.getAll(true));
}

S3D.solver.getLastSolveInfo#

Description: Returns the solver's info/warning messages from the most recent solve โ€” the same messages shown in the S3D solve dialog. Useful for surfacing solve status (or specific warnings per load case/combination) in a custom UI without re-solving.

Operation Type: Synchronous

Access: get

Params: null

Sample:

getLastSolveInfo.js
S3D.solver.getLastSolveInfo();
Sample response
{
"msg": "Solved Successfully!",
"info": ["Linear Static Analysis Completed"],
"info_categorised": {
"general": ["Linear Static Analysis Completed"],
"load_groups": {},
"load_cases": {},
"load_combinations": {}
},
"warnings": [],
"warnings_categorised": {
"general": { "minor": [], "moderate": [], "severe": [] },
"load_groups": {},
"load_cases": {},
"load_combinations": {}
},
"err_code": 0
}