pizarro Posted September 17, 2017 Posted September 17, 2017 Necesito enviar todos las circunferencias a la coordenada z = 0. Esto para poder encontrar las interferencias entre los circunferencias mostradas. Alguien que pueda ayudarme, de ya muchas gracias. Como adjunto el archivo. Ya utilicé la herramienta flatten, pero aparentemente las circunferencias no tienen la coordenada z = 0.PROCESAMIENTO REV D.dwg Quote
BIGAL Posted September 17, 2017 Posted September 17, 2017 2 answers use Filter "Circle" then properties set Z 0.0 Or lisp 2 respuestas utilice Filtro "Círculo" luego las propiedades establecidas Z 0.0 O lisp (defun circ0 ( / ss x obj cen pt) (setq ss (ssget "x" (list (cons 0 "Circle")))) (repeat (setq x (sslength ss)) (setq obj (vlax-ename->vla-object (ssname ss (setq x (- x 1))))) (setq cen (vlax-safearray->list (vlax-variant-value (vla-get-center obj)))) (setq pt (list (car cen) (cadr cen) 0.0)) (vla-put-center obj (vlax-3d-point pt)) ) (circ0) Quote
pizarro Posted September 18, 2017 Author Posted September 18, 2017 Excelent, Thank you very much. Now,how can I get the interference count between all elements, circles, ellipses, etc. Quote
pizarro Posted September 18, 2017 Author Posted September 18, 2017 The plane in dwg is in the first comentary. Please download. Quote
ronjonp Posted September 18, 2017 Posted September 18, 2017 Not very fast, but give this a try: (defun c:foo (/ i i2 o p s) (if (and (setq s (ssget "_x" '((0 . "circle,ellipse") (410 . "Model")))) ;; Convert selset to list of vla objects (setq s (mapcar 'vlax-ename->vla-object (mapcar 'cadr (ssnamex s)))) ;; Put all centers z's @ 0.0 (mapcar '(lambda (x) (setq p (vlax-get x 'center)) (vlax-put x 'center (list (car p) (cadr p) 0.0))) s ) (setq i 0) ) (while (setq o (car s)) (setq s (cdr s)) ;; Check for intersections (if (setq tmp (vl-remove-if-not (function (lambda (x) (if (setq i2 (vlax-invoke o 'intersectwith x acextendnone)) (setq i (+ i (length i2))) ) ) ) s ) ) ;; Make objects green (mapcar '(lambda (x) (vla-put-color x 3)) (append tmp (list o))) ) ) ) (print (strcat (vl-princ-to-string (/ i 3.)) " intersections...")) (princ) ) (vl-load-com) Quote
pizarro Posted September 18, 2017 Author Posted September 18, 2017 Thank you very much. And if we only want to find the number of intersections for a group of selected elements. Quote
ronjonp Posted September 19, 2017 Posted September 19, 2017 Thank you very much.And if we only want to find the number of intersections for a group of selected elements. Try this: (defun c:foo (/ i i2 o p s) (if (and (setq s (ssget ":L" '((0 . "circle,ellipse") (410 . "Model")))) ;; Convert selset to list of vla objects (setq s (mapcar 'vlax-ename->vla-object (vl-remove-if 'listp (mapcar 'cadr (ssnamex s))))) ;; Put all centers z's @ 0.0 (mapcar '(lambda (x) (setq p (vlax-get x 'center)) (vlax-put x 'center (list (car p) (cadr p) 0.0))) s ) (setq i 0) ) (while (setq o (car s)) (setq s (cdr s)) ;; Check for intersections (if (setq tmp (vl-remove-if-not (function (lambda (x) (if (setq i2 (vlax-invoke o 'intersectwith x acextendnone)) (setq i (+ i (length i2))) ) ) ) s ) ) ;; Make objects green (mapcar '(lambda (x) (vla-put-color x 3)) (append tmp (list o))) ) ) ) (print (strcat (vl-princ-to-string (/ i 3.)) " intersections...")) (princ) ) (vl-load-com) Quote
pizarro Posted September 26, 2017 Author Posted September 26, 2017 Excellent, thank you very much. Quote
pizarro Posted April 4, 2018 Author Posted April 4, 2018 Estimado Ronjonp, y para enviar a todos los dibujos a la cota z = 0 sin usar flatten ? Quote
ronjonp Posted April 5, 2018 Posted April 5, 2018 Estimado Ronjonp, y para enviar a todos los dibujos a la cota z = 0 sin usar flatten ? So if I translated your message correctly, THIS should be what you're looking for. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.