Jump to content

Recommended Posts

Posted

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

Posted

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)

Posted

Excelent, Thank you very much.

 

Now,how can I get the interference count between all elements, circles, ellipses, etc.

Posted

The plane in dwg is in the first comentary. Please download.

Posted

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)

Posted

Thank you very much.

And if we only want to find the number of intersections for a group of selected elements.

Posted
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)

  • 6 months later...
Posted

Estimado Ronjonp, y para enviar a todos los dibujos a la cota z = 0 sin usar flatten ?

Posted
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.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...