Archi Forum

Discussion Boards => General Archi Discussion => Topic started by: johmut on September 03, 2021, 11:26:51 AM

Title: Assign Multiple Properties to Multiple (Selected) Objects ?
Post by: johmut on September 03, 2021, 11:26:51 AM
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?
Title: Re: Assign Multiple Properties to Multiple (Selected) Objects ?
Post by: xiaoqi on September 05, 2021, 01: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:


/*
* 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
Title: Re: Assign Multiple Properties to Multiple (Selected) Objects ?
Post by: Jean-Baptiste Sarrodie on September 06, 2021, 10:01:58 AM
Hi,

Quote from: johmut on September 03, 2021, 11:26:51 AM
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