TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Q1241274614 on February 26, 2014, 04:25:00 AM

Title: According to the color formation boundary
Post by: Q1241274614 on February 26, 2014, 04:25:00 AM
According to the color formation boundary。
Title: Re: According to the color formation boundary
Post by: Bhull1985 on February 27, 2014, 08:46:21 AM
According to the color formation boundary, WHAT?

Usually when someone starts a sentence with the word ACCORDING, there is information following the COMMA that the ACCORDING lends itself to, typically.
Title: Re: According to the color formation boundary
Post by: jvillarreal on February 27, 2014, 09:04:46 AM
Q1241274614 is using a translator to post in English (from Chinese).
Perhaps he intended to say:

Boundaries based on color formation
Title: Re: According to the color formation boundary
Post by: Q1241274614 on March 01, 2014, 11:40:50 AM
Sorry? English is not good!

According to the same as the color of the 3dface formation boundary.


Thank you.
Title: Re: According to the color formation boundary
Post by: snownut2 on March 01, 2014, 02:09:50 PM
Sorry? English is not good!

Can't be any worse then my Mandarin ....
Title: Re: According to the color formation boundary
Post by: DEVITG on March 02, 2014, 08:35:30 PM
According to the color formation boundary。


You can not create a boundary in  a not planar entity
Title: Re: According to the color formation boundary
Post by: Q1241274614 on March 04, 2014, 10:34:56 PM
Code: [Select]
(defun c:zz( / a b e1 lst lst1 mid12 mid13 mid32 pt1 pt2 pt3 ss t1)
  (vla-startundomark (vla-get-ActiveDocument (vlax-get-acad-object)))
  (setq ss (ssget(list (cons 0 "3DFACE"))))
  (setq t1 (getvar "TDUSRTIMER"))
  (while (setq e1 (ssname ss 0))
         (setq ss (ssdel e1 ss)  lst (list e1))
         (foreach a (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))
                 (if (= (cdr (assoc 62 (entget e1)))(cdr (assoc 62 (entget a))))
           (progn (setq  lst (cons a lst))  (ssdel a ss)))
         )
        (if lst (setq  lst1 (cons lst lst1)))
   )
  (foreach b lst1
    (foreach a b
    (setq e1  (entget a)
     pt1 (cdr (assoc 10 e1))
          pt2 (cdr (assoc 11 e1))
          pt3 (cdr (assoc 12 e1))
        mid12 (mapcar (function (lambda ( a b ) (/ (+ a b) 2.0))) pt1 pt2)
        mid32 (mapcar (function (lambda ( a b ) (/ (+ a b) 2.0))) pt3 pt2)
        mid13 (mapcar (function (lambda ( a b ) (/ (+ a b) 2.0))) pt1 pt3)
     )
     (if (= 1 (sslength(setq ss (ssget "C" mid12 mid12 '((0 . "3DFACE"))))))
           (entmakex  (list (cons 0 "LINE")(cons 10 pt1)(cons 11 pt2)(cons 8 "boundary")))
           (if (/= (cdr (assoc 62 (entget (ssname ss 0))))(cdr (assoc 62 (entget (ssname ss 1)))))
                  (entmakex  (list (cons 0 "LINE")(cons 10 pt1)(cons 11 pt2)(cons 8 "boundary")))
        )
     )
    (if (= 1 (sslength(setq ss(ssget "C" mid32 mid32 '((0 . "3DFACE"))))))
           (entmakex  (list (cons 0 "LINE")(cons 10 pt3)(cons 11 pt2)(cons 8 "boundary")))
      (if (/= (cdr (assoc 62 (entget (ssname ss 0))))(cdr (assoc 62 (entget (ssname ss 1)))))
                  (entmakex  (list (cons 0 "LINE")(cons 10 pt3)(cons 11 pt2)(cons 8 "boundary")))
        ))
    (if (= 1 (sslength(setq ss(ssget "C" mid13 mid13 '((0 . "3DFACE"))))))
           (entmakex  (list (cons 0 "LINE")(cons 10 pt1)(cons 11 pt3)(cons 8 "boundary")))
      (if (/= (cdr (assoc 62 (entget (ssname ss 0))))(cdr (assoc 62 (entget (ssname ss 1)))))
                  (entmakex  (list (cons 0 "LINE")(cons 10 pt1)(cons 11 pt3)(cons 8 "boundary")))
        )
      )
    )
 )
  (princ (strcat "\n""耗时:" (rtos (* 86400(-(getvar "TDUSRTIMER")t1)) 2 0) "秒"))
  (vla-endundomark (vla-get-ActiveDocument (vlax-get-acad-object)))
  (princ))


Shortcomings:
1. if many objects, the speed is very slow.
2.Only entmake line
3.help


<edit CAB: code tags added>