Jump to content

Recommended Posts

Posted

In the file TEXT-POINT-ZERO.dwg zeta points is zero .

Is there any Lisp program to the value of the text by selecting the point globally or by layer ?

In TEXT-POINT-OK.dwg file it is as it should be ended .

 

Thank you

TEXT-POINT-ZERO.dwg

TEXT-POINT-OK.dwg

Posted

Here is something to get you started. I left the text portion empty for you to practice. Let me know if you need help on it.

(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 - [str] selection prompt
;; arg - [lst] 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
 )
)

Posted

Sorry , I need help .

If the lisp was finished would be ideal .

 

Thank you.

Posted

Quickly patched together

 

(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 - [str] selection prompt
;; arg - [lst] 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
 )
)

Posted

The program selects the points, but the text value is not transferred .

I must do something else?

 

Regards.

Posted

You might want to take a look at the "Similar Threads" at the bottom of this page, specifically the "Point from Text".

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