Author Topic: random selection  (Read 1960 times)

0 Members and 1 Guest are viewing this topic.

flopo

  • Guest
random selection
« on: September 29, 2010, 05:27:47 AM »
Hello everybody,
Is it possible to make a random selection? let's say i have a drawing with all entities possible to be in a 2d drawing, and i want to select 10% from all entity, but randomly? Maybe to have an option to give the percentage of a random selection?
Thanks!

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: random selection
« Reply #1 on: September 29, 2010, 06:23:50 AM »
I think that would be possible:
1. select all elements in the drawing
2. use a random number and ssname to select an element from the set
3. Add this element to a new set
3. repeat until (= (sslength newSet)  (/ (sslength originalSet) 10))

But what would be the practical use of such a function?
« Last Edit: October 01, 2010, 06:33:24 AM by roy_043 »

dgorsman

  • Water Moccasin
  • Posts: 2437
Re: random selection
« Reply #2 on: September 29, 2010, 02:12:39 PM »
Spot check for standards compliance, maybe?
If you are going to fly by the seat of your pants, expect friction burns.

try {GreatPower;}
   catch (notResponsible)
      {NextTime(PlanAhead);}
   finally
      {MasterBasics;}