Author Topic: Assign Multiple Properties to Multiple (Selected) Objects ?  (Read 182 times)

johmut

  • Newbie
  • *
  • Posts: 6
Assign Multiple Properties to Multiple (Selected) Objects ?
« on: September 03, 2021, 12:26:51 PM »
Hi, I can't seem to add Properties to a selection of objects on a view ? let alone Multiple Properties to such a selection? Is there a way?

xiaoqi

  • Active Member
  • ***
  • Posts: 69
  • Today is the Tomorrow we talked about Yesterday
Re: Assign Multiple Properties to Multiple (Selected) Objects ?
« Reply #1 on: September 05, 2021, 02:11:02 AM »
Hello,

If you've enabled jArchi, then it's easier to write several lines of code for this kind of assignment task, like below:

Code: [Select]
/*
 * Archi Script for assigning properties to the selected objects
 */
 
$(selection).prop("property1", "value1");
$(selection).prop("property2", "value2");
$(selection).prop("property3", "value3");

However, the property you assigned to an element object becomes its property, it's attached to the object, not limited to this specific view.

If you want to explore more on the script, you can post more question in the jArchi sub-group.

Hope this helps, regards,
Xiaoqi

Jean-Baptiste Sarrodie

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 716
  • Archi Evangelist and Contributor. Visionary.
    • About me...
Re: Assign Multiple Properties to Multiple (Selected) Objects ?
« Reply #2 on: September 06, 2021, 11:01:58 AM »
Hi,

Hi, I can't seem to add Properties to a selection of objects on a view ? let alone Multiple Properties to such a selection? Is there a way?

That's not supported by Archi because this raises several challenges. As pointed out by Xiaoqi, jArchi (the scriping plugin) can provide some level of support. There's an example of an interractive script here: https://gist.github.com/jbsarrodie/479fde4360eb4187d40022465d28e627

Regards,

JB
If you value and use Archi please consider making a donation! https://www.archimatetool.com/donate