Jump to content

Recommended Posts

Posted (edited)

 

I just joined this forum and I would like to contribute one of my lisp: 'VERIFQTA"to verify the "Forced dimensions", that is to say the value has been changed ... and which often generate errors.

(I translate in english all message)

VERIFQTA.LSP

Edited by X11start
Posted

Welcome 🙂 and thanks for sharing.

I read your description and I think it might do the same as the code below.

; https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-change-color-of-dimensions-with-text-override/m-p/5103678/highlight/true#M323552
(defun c:dimover ( / ent i ss txt)
  (if (setq ss (ssget "_X" '((0 . "DIMENSION"))))
    (repeat (setq i (sslength ss))
      (setq ent	(entget (ssname ss (setq i (1- i))))
	    txt	(cdr (assoc 1 ent))
      )
      (if (not (or (= txt "") (wcmatch txt "*<>*")))
	(if (assoc 62 ent)
	  (entmod (subst (cons 62 2) (assoc 62 ent) ent)) ;; change the color 2 if needed
	  (entmod (append ent (list (cons 62 2)))) ;; change the color 2 if needed
	)
      )
    )
  )
  (princ)
)

 

  • Like 1
Posted

It's actually a much simpler code than my! Thank you!

Posted

Here's another way to write it:

(defun c:dimover ( / i s )
    (if (setq s (ssget "_X" '((0 . "*DIMENSION")(1 . "*?*")(1 . "~*<>*"))))
        (repeat (setq i (sslength s))
            (entmod (append (entget (ssname s (setq i (1- i)))) '((62 . 1))))
        )
    )
    (princ)
)

 

  • Like 2
Posted

Many years ago I was a subscriber to a Commodore 64 newspaper: there was always a column called "one line" in which you tried to put a series of commands in a single line ... even a micro videogame! It was a very useful "synthesis" exercise to avoid creating too verbose codes! Your answers brought me back to those times! Thanks!

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