Archi Forum

Archi => General Archi Discussion => Topic started by: johmut on September 03, 2021, 12:26:51 PM

Title: Assign Multiple Properties to Multiple (Selected) Objects ?
Post by: johmut 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?
Title: Re: Assign Multiple Properties to Multiple (Selected) Objects ?
Post by: Xiaoqi 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:


/*
* 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, 11:01:58 AM
Hi,

Quote from: johmut 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?

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