Message 1 of 11

Not applicable
06-14-2020
08:15 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Dear Experts,
I need a small change in below lisp code. Below lisp code can generate text (as block name) for one block only. The requirement is to generate texts (block names) for multiple selected blocks.
(setq bn_txt nil)
(defun C:bn( / pt1 blname)
(if (null bn_txt)
(progn
(setvar "TEXTSIZE" (getdist "\Height of text label (uses default
style): "))
(setq bn_txt "sizeset")
) ; end progn
) ; end if
(princ "\nAdd block name to drawing.")
(setq blname (cdr (assoc 2 (entget (car (entsel"\nSelect Block:"))))))
(setq pt1 (getpoint"\nSelect centre point for block title:"))
(command "text" "c" pt1 "" "" blname)
)
(princ "\nType BN to execute.")
[/code]
Thanks in advance.
Solved! Go to Solution.