Jump to content

Multiple Enhanced attribute editor LISP


kocbek

Recommended Posts

getdist function would handle two options ( real and integer numbers ) instead of one like getreal function. ;)

 

Huh? getreal will accept any numerical input since any integer is also a real number.

Link to comment
Share on other sites

  • 2 years later...
  • Replies 23
  • Created
  • Last Reply

Top Posters In This Topic

  • Tharwat

    7

  • kocbek

    6

  • pBe

    4

  • BIGAL

    3

Top Posters In This Topic

Posted Images

I need to explode the same block. I already used burst command, but its not exploding. please help me...

 

Invoke the command block then roll down the block you want to explode then check the check toggle on the right side hand of the same dialog if it is checked or not .

Link to comment
Share on other sites

  • 2 years later...

This Lisp worked great, however, is it possible to add exceptions? for instance, if some of the blocks didnt have the height field filled in. As the lisp stands it produces an error when this occurs and no numbers are changed. Also is it possible to add more TAG names to the same lisp.

Thanks for the great work.

quick one:

 

(defun c:ValAddSub (/ aDoc val Tag itm  ss)
 (vl-load-com)
 (setq aDoc (vla-get-ActiveDocument (vlax-get-acad-object)))
 (setq Tag "H");<--- Your point height TAG name      
 (cond
   ((and
      (setq Val (getreal "\n Enter Value to Add/Substract [Negative value to subtract]: "))
      (ssget
        ":L"
        '((0 . "INSERT") (66 . 1))
        )
      (vlax-for
         itm (setq ss (vla-get-ActiveSelectionSet aDoc))
        (if (and
 (setq itm (assoc
                (strcase tag)
                (mapcar
                  (function
                    (lambda (j)
                      (list
                        (vla-get-tagstring j)
                        (vla-get-textstring j)
                        j
                        )
                      )
                    )
                  (vlax-invoke itm 'GetAttributes)
                  )
                )
                )
              )(progn
                  (- (distof (vla-get-textstring (last itm))) val) 
            (vla-put-textstring (last itm) (rtos  (+ (distof (vla-get-textstring (last itm))) val)  2 2)))

          )
        )
      (vla-delete ss)
      )
    )
   )
 )

 

Tharwats code:

 

(if (and
                (eq (cdr (assoc 0 e)) "ATTRIB")
                (not (eq (atof (cdr (assoc 1 e))) 0.))
               [color=blue] (eq (cdr (assoc 2 e)) "H") [/color]
              )
            (entmod
              (subst (cons 1 (rtos (- (atof (cdr (assoc 1 e))) st) 2 [color=blue]2[/color])) (assoc 1 e) e)
            )
          )

Link to comment
Share on other sites

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