, let's say I have 100 columns with unique nodes for each of them, then I want to apply part A for each of them. can I generate a function or expression that will apply part A for all of them considering a unique feature for them? for example their name, material...etc
it would be easier than dragging a line for each node of them.
Hello Abdelrahman,
I tried your example with some unique point nodes. I have used the following function.
function ( ) { Node[] a = Nodes(n=> n is Point && n.XTranslation ==100); // Select all point nodes that have XTranslation equals to 100 for (int i = 0; i < a.Count; ++i) { SetPropertyValue(a[i], 'Part', 'Point'); //set property 'Part' equals to value 'Point' } return a; }
Update the model after running the function. Let me know if this works for you.
https://communities.bentley.com/cfs-file/__key/communityserver-discussions-components-files/360/Select-required-nodes-and-change-its-part.gct
Answer Verified By: Alifur Mandal
Thank you for giving me a start point: it helped but I made some adjusments
function ( ) { Node[] a = Nodes(n => n.Name.StartsWith('slab')); // Select all nodes names that start with slab for (int i = 0; i < a.Count; ++i) { SetPropertyValue(a[i], 'Part', watch1); //set property 'Part' equals to value 'part name' } return a; }