Code Red > AutoLISP (Vanilla / Visual)

Attribute Text Width

(1/2) > >>

MeasureUp:
There is a given attribute named as ATT-01 in a given block BLK-01.
How to change the attribute text width to 0.75?

I did a search here but don't find what I am exactly after.

Thanks in advance.

Lastknownuser:
Try this it should work

--- Code: ---(defun c:test ( / int sel ent get)
(setq int -1)
(setq sel (ssget '((0 . "INSERT") (2 . "BLK-01"))));BLK-01
(while (setq int (1+ int)
     ent (ssname sel int)
     );setq
  (while (/= (cdr (assoc 0 (setq get (entget (setq ent (entnext ent)))))) "SEQEND")
    (if (= (cdr (assoc 2 get)) "ATT-01");ATT-01
      (entupd (cdr (assoc -1 (entmod (subst (cons 41 0.75) (assoc 41 get) get)))));0.75
      );if
    );while
  );while
);defun
--- End code ---

edit: localised all variables

MeasureUp:
Thanks for the help.
And sorry for the late reply as too busy after Easter.

Another thought...
How to update the text width if it is an attribute in title blocks in a multi-page drawing?
Thanks.

ribarm:

--- Quote from: MeasureUp on May 06, 2024, 07:07:41 AM ---Thanks for the help.
And sorry for the late reply as too busy after Easter.

Another thought...
How to update the text width if it is an attribute in title blocks in a multi-page drawing?
Thanks.

--- End quote ---

Have you tried changing this line :

--- Code: ---(setq sel (ssget '((0 . "INSERT") (2 . "BLK-01"))));BLK-01

--- End code ---
To this :

--- Code: ---(setq sel (ssget "_X" '((0 . "INSERT") (2 . "BLK-01"))));BLK-01

--- End code ---
And then iterate through sel. set 'sel'...

MeasureUp:
Thanks.

I was thinking of using "vla-put-textwidth" but didn't figure it out.
Can anyone help?
Thanks again.

Navigation

[0] Message Index

[#] Next page

Go to full version