- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Good afternoon,
I am looking for a way to modify Auto Number Lisp to have a user-selected object instead of "_x". So far I have found how to initiate the user-input via Get Basic Block Name, but it is not recognizing the name after swapping "_11x17" for the "bname" set. Is there a way to have one 'user selected object' to retrieve both the name and object type (block in this case)?
In other words, I am looking to replace "_x" in "Auto Number Lisp" with a user selection on-screen and still run the lisp. The purpose is this lisp works when the block has the same name between every drawing, but though the layout is identical, our blocks are from different sources and usually have different block names.
Secondly (and on the thought of the previous paragraph), could it be possible to rename a block to something specific upon clicking a block?
(defun c:SHEETNO (/ adoc bname layoutname ss1 ent entdata) (setq bname (vla-get-bname (setq adoc (vla-get-activedocument (vlax-get-acad-object))))) (setq bname (vla-get-effectivename (vlax-ename->vla-object (car (entsel "\nSelect block: "))))) ;(if (setq ss1 (ssget "_x" '((0 . "INSERT") (2 . "_11x17")))) (mapcar '(lambda (x) (setq ent (cadr x) entdata (entget ent)) (while (/= (cdr (assoc 0 entdata)) "SEQEND") (cond ((= "SHEETNO" (cdr (assoc 2 entdata))) (vlax-for y bname (cond ((= (vla-get-name (vla-objectidtoobject adoc (vla-get-ownerID (vlax-ename->vla-object (cdr (assoc 330 entdata)))))) (vla-get-name (vla-get-block y))) (entmod (subst (cons 1 (itoa (vla-get-taborder y))) (assoc 1 entdata) entdata))) (T ()))) )) (setq entdata (entget (setq ent (entnext ent)))))) (ssnamex ss1)) "No titleblocks found!") (princ))
Thank you.
https://www.youracclaim.com/badges/9aa4a1d5-0d02-4888-be6f-ed8f0653d8ad/public_url
Solved! Go to Solution.