Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/02/2022 in all areas

  1. Try this: (defun c:foo (/ b c h n s) ;; RJP » 2022-12-02 (cond ((and (or (setq h (getdist "\nEnter height:<1> ")) (setq h 1)) (setq s (ssget '((0 . "INSERT") (66 . 1)))) ) (setq b (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object)))) (setvar 'cmdecho 0) (foreach e (vl-remove-if 'listp (mapcar 'cadr (ssnamex s))) (setq n (vla-get-effectivename (vlax-ename->vla-object e))) (or (member n c) (progn (vlax-for a (vla-item b n) (if (= "AcDbAttributeDefinition" (vla-get-objectname a)) (progn (vl-catch-all-apply 'vlax-put (list a 'height h)) (setq c (cons n c))) ) ) (command "_.Attsync" "Name" n) ) ) ) (setvar 'cmdecho 1) ) ) (princ) ) (vl-load-com) And with your code, use WHILE rather than REPEAT. Also check that the item has a height property AND can be modified before trying to set it. (defun c:test (/ e h) (or (setq h (getdist "\nEnter height of text:<1> ")) (setq h 1)) (while (setq e (car (nentsel "\nSelect an attribute to change:"))) (if (and (vlax-property-available-p (setq e (vlax-ename->vla-object e)) 'height) (vlax-write-enabled-p e) ) (vla-put-height e h) ) ) (princ) )
    2 points
  2. It is not a single block, there are many and in many drawings, for that reason I am looking for a lisp
    1 point
  3. When coding I use drag and drop a lot or just copy and paste. My Notepad++ had the Active X plugin which allows you to run the code in N++ by just typing a command "N++" in CAD, well worth looking into. Unfortunately mine has stopped working after doing a software upgrade. A menu of select a block via slides I made by getting all block names and write out the mnu code. Then paste into the actual mnu. Did like 5 types with around 20 slides per type. Yes Toolbars can be made easy only hiccup is a ICON is needed. The ribbon is a difficult beast as you have to use the CUI to make, you can actually look inside and see how they are made but they are a XML group of files, it is on my to do list one day making from say a csv text file. Copy a CUIX then rename to .ZIP then have a look.
    1 point
  4. Open in the block editor, make your changes then run attsync on it.
    1 point
×
×
  • Create New...