S3D.file


The S3D.file namespace provides functionality allowing the user to interact with their file manager on the SkyCiv platform.


S3D.file.save#

Save a model to the user's SkyCiv cloud storage.

important

S3D.model.set must be called earlier in the session.

KeyTypeDescription
namestringFile name of the model
pathstringPath in the user's cloud file storage
public_sharebooleanAlso return a link for a public share link (view only)

Sample input for the S3D.file.save function#

{
"function": "S3D.file.save",
"arguments": {
"name": "project file name",
"path": "api/new-folder/",
"public_share": true
}
}

Sample response for the S3D.file.save function#

The response will confirm whether or not the model was successfully saved to the user's SkyCiv cloud storage. It will also include a link to the model:

{
"data": "https://platform.skyciv.com/structural?preload_name=API%20File%20Name&preload_path=api/new-folder/",
"msg": "Model was successfully saved to your SkyCiv cloud storage in the folder api/new-folder/. You can access this file from your SkyCiv Dashboard, or directly from https://platform.skyciv.com/structural?preload_name=API%20File%20Name&preload_path=api/new-folder/",
"status": 0,
"public_link": "https://platform.skyciv.com/structural-viewer?project_id=snwzxPUTolIfdgXQvI8pBc8a7STIl8Px0uB03KD7dRfjBJT5cMh8YfUk4RRBp5um"
}

Visit the URL to view, analyse and modify the model in Structural 3D.



S3D.file.open#

Load a model from the user's SkyCiv cloud storage.

KeyTypeDescription
namestringFile name of the model.
pathstringPath in the user's cloud file storage
load_resultsbooleanBoolean to load analysis results with file (false by default)

Sample input for the S3D.file.open function#

{
"function": "S3D.file.open",
"arguments": {
"name": "Sample Model",
"path": "Project Name/QA/"
}
}

Sample response for the S3D.file.open function#

{
"status": 0,
"msg": "File Loaded: model 'Sample Model' is set."
}


S3D.file.share#

Share a model with another SkyCiv user.

KeyTypeDescription
namestringFile name of the model to share.
pathstringPath in the user's cloud file storage.
share_with[string]An array of SkyCiv email addresses to share the model with.

Sample input for the S3D.file.share function#

{
"function": "S3D.file.share",
"arguments": {
"path": "Project Name/QA/",
"name": "Sample Model",
}
}

Sample response for the S3D.file.share function#

The response will contain a confirmation message, a list of shared users and a public (view only) link.

{
"status": 0,
"msg": "File was successfully shared.",
"data": {
"shared_user": ["[email protected]", "[email protected]"],
"share_link": "https://platform.skyciv.com/structural-viewer?project_id=URQfJBu4vR8SwWaxgdhOFaZ5KINbVQ7vNLG7GIjWnvtZgZInKo5j1vtuxkvOsJ"
}
}


S3D.file.getFileDirectory#

Returns a list of files and folders of in the user's cloud storage. Useful for locating files or building a tree of files.

KeyTypeDescription
pathstringPath in the user's cloud file storage. "" will return the contents of the root directory.
full_listbooleanReturn user's entire file directory in a nested format.
full_list_flatbooleanReturns the data as a flattened list for easier iteration.

Sample input for the S3D.file.getFileDirectory function#

{
"function": "S3D.file.getFileDirectory",
"arguments": {
"path": "Project folder"
}
}

Sample response for the S3D.file.getFileDirectory function#

The below response shows the contents of the folder, which includes one folder called QA and a file (model) called FCSP Moment Frame ASD - for revit.

{
"status": 1,
"msg": "2 items were found.",
"data": [
{
"class": "folder",
"special": "shared",
"privacy": "private",
"file_name": "QA",
"thumbnail": "",
"job_name": "",
"job_notes": "",
"last_changed": 1570089100,
"nodes": "",
"members": "",
"shared_alias": "",
"file_owner_email": ""
},
{
"class": "file",
"special": "shared",
"privacy": "private",
"file_name": "FCSP Moment Frame ASD - for revit",
"thumbnail": "1_2lWNO0EIbSHQ8AH7wWTE2Z2H1bwHyaMLmAimTSEKGfoVLN4xsFK4EjhyaTv0d4EV.png",
"job_name": "",
"job_notes": "",
"last_changed": 1556773710,
"nodes": 152,
"members": 175,
"shared_alias": "",
"file_owner_email": ""
}
]
}


S3D.file.restoreVersion#

SkyCiv has built in version control for your models. Rollback previous versions of your file using this function.

KeyTypeDescription
rollback_versionsintegerNumber of models to rollback

Sample input for the S3D.file.restoreVersion function#

{
"function": "S3D.file.restoreVersion",
"arguments": {
"rollback_versions": 2
}
}