Tharwat 发表于 2022-7-6 00:14:19

 
不客气,卢卡斯,谢谢你的好话和赞扬

Tharwat 发表于 2022-7-6 00:16:46

 
正确,我在写之前就想过了,但在这种情况下,你使用的函数是一个麻烦的问题,因为比例因子会迫使用户过于接近第一个选择的维度,从而避免该函数的大规模性能,所以我这样做

lucas3 发表于 2022-7-6 00:22:07

 
谢谢你帮我?不我会感到羞耻的,我在帖子#9还有一个问题

Tharwat 发表于 2022-7-6 00:24:01

 
可能是。。。
 

(defun c:Test (/ s p e gr)
;;    Author : Tharwat 20. jan. 2014    ;;
(if (setq s (ssget "_+.:S:E:L" '((0 . "TEXT,MTEXT"))))
   (progn
   (setq p (cdr (assoc 10 (entget (setq e (ssname s 0))))))
   (while (eq (car (setq gr (grread t 15 0))) 5)
       (redraw)
       (grdraw p (cadr gr) 1 -1)
       (vla-put-height
         (vlax-ename->vla-object e)
         (atoi (rtos (distance p (cadr gr))))
      )
   )
   (redraw)
   )
)
(princ)
)
(vl-load-com)

pBe 发表于 2022-7-6 00:27:45

tharwat不错,不过建议很快。
. if you are to use your approach (textheight * distance) for multiple selection and the text/mtext entities are of varying height to start with. you will end up with same text height for all. Suggest you use ScaleEntity method and use a multiplier to maintain the ratio. but thats just me.<p> </p><p>I have not looked at the other code , but i'm pretty sure the same approach as above or something to that effect would be a better option.</p><p> </p><p>Just my 2 cents.</p><p> </p><p>EDIT: Looks like MSasu beat me to it with regards to DIM ratio</p>

Tharwat 发表于 2022-7-6 00:31:20

感谢pBe的建议,非常感谢,正如我在前面回复MSasu时提到的那样,我确实想到了这种方法,但我也认为用户看到性能优于scaleEntity方法会更好。
 
当做

pBe 发表于 2022-7-6 00:34:33

 
嗯,我真的不同意。特别是在涉及比率问题的情况下。我想我会坚持ScaleEntity和/或ScaleFactor方法。
 
再说一次,只有我的2美分。

lucas3 发表于 2022-7-6 00:36:20

 
真 的!我爱你,塔瓦,pBe,ymg3,马尔科·里巴和麦克·李,你是论坛的骄傲

lucas3 发表于 2022-7-6 00:39:01

 
谢谢Tharwat,代码很棒!那么昏暗的高度呢

flyfox1047 发表于 2022-7-6 00:42:42

 
是的,你说得对,他们是一个好人,伟大的lisp作者,是CADTutor论坛的全面资产。我们很幸运他能继续参与进来。
页: 1 [2]
查看完整版本: 动态更改文本,具有