Skip to content

Instantly share code, notes, and snippets.

View trischbeck's full-sized avatar

trischbeck

  • ITMC
  • Zurich
View GitHub Profile
@trischbeck
trischbeck / AlignSpreadVertically.ajs
Last active September 17, 2021 10:24
Sorts selected visual elements within a view, based on https://gist.github.com/robkamp/fac2b2d80ee44e7085c70738de544341 #archi
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Script Name: alignVertically
Purpose: Sorts selected visual elements within a view by ID (alphabetically) and stacks them in a vertical layout
Builds on the AlignSpreadHorizontally script by Rob Kamp (https://gist.github.com/robkamp/fac2b2d80ee44e7085c70738de544341)
Thomas Rischbeck, rischbeck@itmc.ch, (C) ITMC 2021
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */// Author: Rob Kamp
@trischbeck
trischbeck / sort-and-layout-assessments
Last active August 13, 2021 09:08
#jarchi Sorts selected assessments within a view by ID and stacks them in a vertical layout
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Script Name: sort-and-layout-assessments
Purpose: Sorts selected assessments within a view by ID and stacks them in a vertical layout
Builds on the AlignSpreadVertically script by Rob Kamp
Thomas Rischbeck, rischbeck@itmc.ch, (C) ITMC 2021
v2 all assessments same size and with label expression
@trischbeck
trischbeck / colorAssessments.ajs
Created August 11, 2021 13:48
#jarchi Color all assessment elements in the model according to a given property.
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Script Name: colorAssessments
Purpose: Color all assessment elements in the model according to a given property.
Dependening on this property's value the color is set on a red-yellow-green scale.
default values: property_name = "bewertung"; min_value = -10 (weak); max_value = 10 (strong)
Thomas Rischbeck, rischbeck@itmc.ch, (C) ITMC 2021
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@trischbeck
trischbeck / exportToExcelCSV.ajs
Last active October 8, 2022 14:41
#jarchi Export all elements from the current model (including their properties) to a CSV file which can be opened in Excel.
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Script Name: exportToExcelCSV
Purpose: Export all elements from the current model (including their properties) to a CSV file which
can be opened in Excel. This also works for special characters and for German locale.
Export uses latin encoding and replaces some characters so that Excel can directly open the CSV
(double-click).
This works in conjunction with smileham's importFromCSV to reimport changes (but doesn't require PapaParse),
see https://gist.github.com/smileham/1e57a5946235e780dee5a824f664aa3d