Jump to content

VLISP property for "Text Inside" of a dimension


Recommended Posts

Posted

I want to create a lisp that will toggle this property of individual dimensions.  I looked through the DXF codes on the autodesk website and I also went through the VLA-OBJECT properties but I can't find it.  

ipFSmeB.png

Posted

wow lol. Where would I even find that info?  Thanks man!

Posted

Never mind. I guess I totally missed it in the list. I went over it several times too lol. Thanks again.

Posted (edited)
9 minutes ago, guitarguy1685 said:

Never mind. I guess I totally missed it in the list. I went over it several times too lol. Thanks again.

Glad to help .. I used the VLIDE to find it:  VLA-PUT-TEXT then CNTRL+SHIFT+A or CNTRL+SHIFT+SPACE

image.png.26672b763498bc4d8989244e873a1c23.png

Edited by ronjonp
  • Like 1
  • Thanks 1
Posted

well that's a nice little trick.  I learned more than I anticipated. 

Posted

This is one particular task where the individual ActiveX properties accessible through Visual LISP are a huge advantage...

 

Consider the following toggle implemented in Visual LISP:

(defun c:txtin-visual ( / i o s )
    (if (setq s (ssget "_:L" '((0 . "*DIMENSION"))))
        (repeat (setq i (sslength s))
            (setq i (1- i)
                  o (vlax-ename->vla-object (ssname s i))
            )
            (vlax-put o 'textinside (~ (vlax-get o 'textinside)))
        )
    )
    (princ)
)
(vl-load-com) (princ)

Compared with the corresponding Vanilla AutoLISP solution:

(defun c:txtin-vanilla ( / a b e i s x )
    (if (setq s (ssget "_:L" '((0 . "*DIMENSION"))))
        (progn
            (regapp "ACAD")
            (repeat (setq i (sslength s))
                (setq i (1- i)
                      e (ssname s i)
                )
                (cond
                    (   (not
                            (and
                                (setq x (cdadr (assoc -3 (entget e '("ACAD")))))
                                (setq a (cdr (member '(1000 . "DSTYLE") x)))
                            )
                        )
                        (setq x
                            (append x
                               '(
                                    (1000 . "DSTYLE")
                                    (1002 . "{")
                                    (1070 . 174)
                                    (1070 . 001)
                                    (1002 . "}")
                                )
                            )
                        )
                    )
                    (   (not (setq b (cdr (member '(1070 . 174) a))))
                        (setq x
                            (append
                                (reverse (member '(1000 . "DSTYLE") (reverse x)))
                               '(
                                    (1002 . "{")
                                    (1070 . 174)
                                    (1070 . 001)
                                )
                                (cdr a)
                            )
                        )
                    )
                    (   (setq x
                            (append
                                (reverse (member '(1000 . "DSTYLE") (reverse x)))
                                (reverse (member '(1070 . 174) (reverse a)))
                                (cons (cons 1070 (- 1 (cdr (assoc 1070 b)))) (cdr b))
                            )
                        )
                    )
                )
                (entmod (append (entget e) (list (list -3 (cons "ACAD" x)))))
            )
        )
    )
    (princ)
)

 

  • Like 2

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