Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/28/2019 in all areas

  1. Yep, the more cores you have, the faster you can render. And the price is nearly identical, so that would be my choice.
    1 point
  2. It seems much faster and smoother now.
    1 point
  3. Glad to help like ronjonp a square may not give correct answer. Same with some odd sized shapes see image above as I only do a simple compare.
    1 point
  4. Ha! It only just came back for me. DNS changes will vary depending where you are around the globe. So far it's looking good but do let me know if you spot anything odd.
    1 point
  5. Here's another way to do it. Does not work on squares. (defun c:foo (/ pts s) ;; RJP » 2019-08-27 (cond ((setq s (ssget '((0 . "lwpolyline") (90 . 4)))) (foreach pl (vl-remove-if 'listp (mapcar 'cadr (ssnamex s))) (setq pts (mapcar 'cdr (vl-remove-if '(lambda (x) (/= 10 (car x))) (entget pl)))) (setq pts (mapcar '(lambda (r j) (list (distance r j) (mapcar '/ (mapcar '+ r j) '(2 2 2)))) pts (append (cdr pts) (list (car pts))) ) ) (setq pts (vl-sort pts '(lambda (r j) (< (car r) (car j))))) (entmakex (list '(0 . "line") '(8 . "line") '(62 . 1) (cons 10 (cadr (car pts))) (cons 11 (cadr (cadr pts))) ) ) ) ) ) (princ) )
    1 point
  6. Here's a good start for you with some comments to help you learn. It does not explode the blocks but will do the layering. Welcome to CadTutor! (defun c:foo (/ co d la ln lp rgb x) ;; RJP » 2019-08-27 ;; Not much error checking! ;; Unlock all layers (vlax-for a (vla-get-layers (setq d (vla-get-activedocument (vlax-get-acad-object)))) (vlax-put a 'lock 0) ) ;; Iterate all drawing objects (vlax-for a (vla-get-blocks d) (vlax-for b a ;; Get truecolor object (setq co (vla-get-truecolor b)) ;; Get RGB values for layername and check to swap black for white etc... (setq rgb (mapcar '(lambda (x) (vlax-get co x)) '(red green blue))) ;; Check for bylayer, index color or change rgb if 0,0,0 or 0,0,1 (setq rgb (cond ((= 256 (vla-get-color b)) ;; Uses the index color of the layer the object is already on (list (vla-get-color (vla-add (vla-get-layers d) (vla-get-layer b)))) ) ;; Index color ((null (assoc 420 (entget (vlax-vla-object->ename b)))) (list (vla-get-color b))) ;; Black to white ((equal '(0 0 0) rgb) '(255 255 255)) ;; Almost black to black ((equal '(0 0 1) rgb) '(0 0 0)) ;; Just return RGB (rgb) ) ) ;; Set RGB colors if list has 3 elements (and (= 3 (length rgb)) (vla-setrgb co (car rgb) (cadr rgb) (caddr rgb))) ;; Create layer prefix based on object type (setq lp (cond ((= "AcDbHatch" (vla-get-objectname b)) "Hatch") ("Linework") ) ) ;; Uncomment below to create layer prefix based on object type not grouped as "Linework" ;; (setq lp (substr (vla-get-objectname b) 5)) ;; Add new layer (setq la (vla-add (vla-get-layers d) (setq ln (strcat lp " - " (vl-princ-to-string rgb))))) ;; Set layer color (if (= 1 (length rgb)) (vla-put-color la (car rgb)) (vla-put-truecolor la co) ) ;; Make object color bylayer (vla-put-color b 256) ;; Move object to layer (vla-put-layer b ln) ) ) ;; Purge 3 times (repeat 3 (vla-purgeall d)) (princ) )
    1 point
×
×
  • Create New...