Hello, whenever I have a macro with a loop that scans the fence, when the zoom in the drawing is large, the program works slowly and when the zoom is small, the program works quickly?
same task:
time for big zoom
time for small zoom
I suspect that the circle used to define your fence is being stroked to a different number of points based on it's size in the view.
Fence processing works on a set of convex clip planes, so when a fence is defined by curves and the fence has a view associated with it, it's stroked to a view based tolerance. Lots of clip planes means testing against the fence takes more time.
If you want to use a fence for this, try creating it from a N-sided polygon (choose a reasonable number for N that doesn't take to long to process and is accurate enough for your use case). The approach Jan outlines is perfectly reasonable as well.
HTH
-B
Hi Brien,
thanks for the insight into fence processing mechanism!
Regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point