gedu 发表于 2022-7-5 17:27:16

文字输入点

在文件TEXT-POINT-ZERO中。dwg zeta点为零。
是否有任何Lisp程序通过全局选择点或按层选择文本值?
在TEXT-POINT-OK中。dwg文件,因为它应该结束。
 
非常感谢。
文本点零。图纸
TEXT-POINT-OK。图纸

broncos15 发表于 2022-7-5 17:47:22

这里有一些东西可以让你开始。我把课文部分留空给你练习。如果你需要帮助,请告诉我。
(defun c:test (/ ss dxf10 elev cnt *error*)
(defun *error* (msg)
   (if (not
         (member msg '("Function cancelled" "quit / exit abort"))
       )
   (princ (strcat "\nError: " msg))
   )
   (princ)
)
(if (setq ss
            (LM:ssget "\nSelect Points to Add Elevation Text: "
                      '(((0 . "POINT")))
            )
   )
   (progn
   (setq cnt 0)
   (repeat (sslength ss)
       (setq dxf10 (cdr (assoc 10 (entget (ssname ss cnt))))
             elev(caddr dxf10)
             cnt   (+ cnt 1)
       )
;;; Now you just need to add in the text code, it will be based on what offset from the point you
;;; want
   )
   )
)
(princ)
)

;; ssget-Lee Mac
;; A wrapper for the ssget function to permit the use of a custom selection prompt
;; msg - selection prompt
;; arg - list of ssget arguments
(defun LM:ssget (msg arg / sel)
(princ msg)
(setvar 'nomutt 1)
(setq sel (vl-catch-all-apply 'ssget arg))
(setvar 'nomutt 0)
(if (not (vl-catch-all-error-p sel))
   sel
)
)

gedu 发表于 2022-7-5 18:00:10

对不起,我需要帮助。
如果Lisp程序完成了,这将是理想的。
 
非常感谢。

BIGAL 发表于 2022-7-5 18:11:42

快速拼接
 

(defun c:test (/ ss dxf10 elev cnt *error*)
(defun *error* (msg)
   (if (not
         (member msg '("Function cancelled" "quit / exit abort"))
       )
   (princ (strcat "\nError: " msg))
   )
   (princ)
)
(alert "Select Points to Add Elevation Text: ")
(if (setq ss(ssget (list(cons 0"POINT"))))
   
   (progn
   (setq cnt 0)
   (repeat (sslength ss)
       (setq dxf10 (cdr (assoc 10 (entget (ssname ss cnt))))
             elev(caddr dxf10)
             cnt   (+ cnt 1)
       )
(command "Text" dxf10 "" "" (rtos elev 2 3))
;;; Now you just need to add in the text code, it will be based on what offset from the point you
;;; want
   )
   )
)
(princ)
)
;; ssget-Lee Mac
;; A wrapper for the ssget function to permit the use of a custom selection prompt
;; msg - selection prompt
;; arg - list of ssget arguments
(defun LM:ssget (msg arg / sel)
(princ msg)
(setvar 'nomutt 1)
(setq sel (vl-catch-all-apply 'ssget arg))
(setvar 'nomutt 0)
(if (not (vl-catch-all-error-p sel))
   sel
)
)

gedu 发表于 2022-7-5 18:21:47

程序选择点,但不传输文本值。
我必须做点别的?
 
当做

BKT 发表于 2022-7-5 18:32:09

您可能想看看本页底部的“类似线程”,特别是“文本点”。
页: [1]
查看完整版本: 文字输入点