Message 1 of 6

Not applicable
04-04-2019
12:28 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Dear Experts,
Requesting your help to update the code as it should ask Prefix and Suffix at user input from command prompt. The code is below
(defun c:NI (/ oldent newent) (setq oldent (cdr (entget(car(entsel "Select text: "))))) (if (/= (cdr(assoc 0 oldent)) "TEXT") (progn (princ "No Text Selected") ) ;loop until user cancels command (while T (progn ;increment text and substitute it in the DXF group 1 entity data (setq newent (subst (cons 1 (itoa (+ 1 (atoi (cdr(assoc 1 oldent)))))) (assoc 1 oldent) oldent)) ;get a new point and substitute the DXF group 10 code with the new point (setq newent (subst (cons 10 (getpoint "\nCopy to: ")) (assoc 10 newent) newent)) ;reset ready to start again (setq oldent (entmake newent)) ) ) ) ;exit cleanly (princ) )
Solved! Go to Solution.