Percentages to Hatch

Percentages to Hatch

Anonymous
Not applicable
808 Views
3 Replies
Message 1 of 4

Percentages to Hatch

Anonymous
Not applicable

I have a hexagonal paving pattern, I want to as closely as possible show a random assortment of three different colored pavers. I was wondering if there is a way to hatch a percentage of the total pavers with one hatch.

 

For instance: say there are 1000 pavers, would it be possible to randomly select 1/3 of the total to then hatch, then of the remaining 667, select 1/2 to assign a different hatch.

 

Is anything similar to this desired outcome easily possible?

 

Thanks

0 Likes
Accepted solutions (1)
809 Views
3 Replies
Replies (3)
Message 2 of 4

Moshe-A
Mentor
Mentor

@Anonymous  hi,

 

The hatch command has no such options but post a sample dwg so we can see what you mean?!

 

moshe

 

0 Likes
Message 3 of 4

imadHabash
Mentor
Mentor

Hi,

i suggest to check if SUPERHATCH (Express Tool) will help you . you can created blocks with different layers, colors, and linetypes to create hatch patterns that react to layer states and plot with a variety of line weights.  >> Click <<

 

 

Imad Habash

EESignature

0 Likes
Message 4 of 4

leeminardi
Mentor
Mentor
Accepted solution

The following program will randomly change the layer of selected objects to one of three layers.  You may be able to adapt it to your needs.

(defun c:demo (/ r i l n s x)
; changes the layer randomly to one of three options
; layer1, layer2, or layer3
  (setq s (ssget))
  (repeat (setq i (sslength s))
    (setq r (LM:rand))
    (setq x (entget (ssname s (setq i (1- i))))
	  l (assoc 8 x)
    )
    (if	(< r 0.3333)
      (setq n "layer1")
      (progn
	(if (< r 0.66667)
	  (setq n "layer2")
	  (setq n "layer3")
	)				; end if 
      )					;end progn
    )
    (entmod (subst (cons 8 n) l x))
  )
  (princ)
)



;; Rand  -  Lee Mac
;; PRNG implementing a linear congruential generator with
;; parameters derived from the book 'Numerical Recipes'

(defun LM:rand ( / a c m )
    (setq m   4294967296.0
          a   1664525.0
          c   1013904223.0
          $xn (rem (+ c (* a (cond ($xn) ((getvar 'date))))) m)
    )
    (/ $xn m)
)

 

lee.minardi