I am trying to change the object properties like Layer, Display Color, etc. but I want to keep some properties stay same. So, I cannot use MatchObjectProperties Method because it will change all the properties of the objects.
Seemingly, the only option I have now is to loop through each object and change each property using ObjectLayer, ObjectLinetype, etc. But, this option is too slow for looping thousands of objects I have in my drawings. Is there any other workaround? Or that part must stick to non-script way?
Most of these are object attributes, so you can modify them all at once:
import rhinoscriptsyntax as rs
import scriptcontext as sc
for obj_id in obj_ids:
#etc. for all desired attributes
Don’t know how much faster that is…
I tried such method previously, but it was taking too much time. I thought the reason was because it was loading full object instance in each loop; not the guid as in ModifyAttributes method.
Now, I looked at my code again; I was looping Views.Redraw() for every object!! Now I put it outside the loop and it runs fast indeed.
Thanks for your reply.