你好,李,谢谢你的快速回复
我已经做了一些例行工作来完成第一个请求,但我发现了一个小错误。
当然,黄点是内部的,但它不适用于我的应用程序。
我正在混凝土板中绘制路缘(找不到正确的英文单词,抱歉)。
有没有办法确定这一点?
这是我的代码:
- ....
- (setq ent (vlax-ename->vla-object (car (entsel))))
- (setq coordinate (vlax-safearray->list (vlax-variant-value (vlax-get-property ent 'Coordinates))))
- ;(command-s "_erase" (entlast) "")
- ;(vlax-invoke-method ent 'delete)
-
- (setq n_punti (/ (length coordinate) 2))
-
- ;creazione lista punti e individuazione punti interni
- (while (/= indice n_punti)
- (setq punto_ins (list (nth (* 2 indice) coordinate) (nth (+ (* 2 indice) 1) coordinate)))
- (setq lista_punti (cons punto_ins lista_punti))
- (setq indice (1+ indice))
- )
- (setq punti_esterni (LM:ConvexHull lista_punti)) ;[b]THANKS!!![/b]
-
- (setq indice 0)
- (WHILE (/= indice n_punti)
- (IF (= (member (NTH indice lista_punti) punti_esterni) nil)
- (SETQ punti_interni (CONS (NTH indice lista_punti) punti_interni))
- )
- (SETQ indice (1+ indice))
- )
- ;inserimento cordoli
- (setq indice 0 indice_2 0)
- (WHILE (/= indice n_punti)
-
- (IF (= indice_2 (- n_punti 1))
- (setq indice_2 0)
- (setq indice_2 (1+ indice))
- )
- (VL-CMDF "_.-insert" nome_blocco (nth indice lista_punti) "" "" (* 180 (/ (angle (nth indice lista_punti) (nth indice_2 lista_punti)) pi)))
- (setq ent (vlax-ename->vla-object (entlast)))
- (COND ((and (= (member (NTH indice lista_punti) punti_interni) nil) (= (member (NTH indice_2 lista_punti) punti_interni) nil)) ;[b]MODEL 1[/b]
- (putdynpropvalue ent "lunghezza1" (- (distance (nth indice lista_punti) (nth indice_2 lista_punti)) (* dist_bordo 2)))
- )
-
- ((and (/= (member (NTH indice lista_punti) punti_interni) nil) (= (member (NTH indice_2 lista_punti) punti_interni) nil)) ;[b]MODEL 2[/b]
- (putdynpropvalue ent "lunghezza1" (- (distance (nth indice lista_punti) (nth indice_2 lista_punti)) (* dist_bordo 2)))
- (putdynpropvalue ent "lunghezza2" (+ (distance (nth indice lista_punti) (nth indice_2 lista_punti)) estensione larghezza))
- )
- ((and (= (member (NTH indice lista_punti) punti_interni) nil) (/= (member (NTH indice_2 lista_punti) punti_interni) nil)) ;[b]MODEL 3[/b]
- (putdynpropvalue ent "lunghezza1" (+ (distance (nth indice lista_punti) (nth indice_2 lista_punti)) estensione larghezza))
- )
- ((and (/= (member (NTH indice lista_punti) punti_interni) nil) (/= (member (NTH indice_2 lista_punti) punti_interni) nil)) ;[b]MODEL 4[/b]
- (putdynpropvalue ent "lunghezza1" (+ (distance (nth indice lista_punti) (nth indice_2 lista_punti)) larghezza estensione))
- (command "rigen")
- (putdynpropvalue ent "lunghezza2" (+ (distance (nth indice lista_punti) (nth indice_2 lista_punti)) (* 2(+ dist_bordo larghezza estensione))))
-
-
-
- )
- )
- (putdynpropvalue ent "larghezza" larghezza)
- (inserisci_attr nome_cordolo)
- (SETQ indice (1+ indice))
- )
- ...
谢谢,丹尼斯
(完成后,我将处理第二个请求)
编辑:我现在试试第二种方法,也许这是避免这个问题的唯一方法。:/ |