Author Topic: jArchi script to set properties?  (Read 273 times)

casacde

  • Member
  • **
  • Posts: 10
jArchi script to set properties?
« on: July 01, 2019, 07:50:27 AM »
I take my first steps with jArchi and wondered if there is an approach or a finished script that allows me to set the properties of several (or all) elements in my model? Can someone give me an indication of how I come to a solution? Many Thanks!

Phil Beauvoir

  • Administrator
  • Hero Member
  • *****
  • Posts: 1619
  • Code Punk
    • Archi
Re: jArchi script to set properties?
« Reply #1 on: July 01, 2019, 10:16:30 AM »
The general approach with jArchi is to use the various selectors that return a collection of objects and then set or read the properties on those.

For example to set a property on all elements in a model:

$("element").prop("key", "value");

You could also filter the collection further to select only certain types of elements, or those that meet a certain condition.

More examples - https://gist.github.com/search?utf8=%E2%9C%93&q=%23jarchi+extension%3Aajs&ref=searchresults

Reference - https://github.com/archimatetool/archi-scripting-plugin/wiki/jArchi-Collection
« Last Edit: July 01, 2019, 21:17:52 PM by Phil Beauvoir »
If you value and use Archi please consider making a donation! https://www.archimatetool.com/donate