leonucadomi Posted July 11, 2022 Posted July 11, 2022 HELLO IS THERE ANY LSP ROUTINE THAT CAN COPY THE CONTENT OF ONE ATTRIBUTE TO OTHERS? IN THE EXAMPLE FILE COPY THE 008 TO THE ATTRIBUTES WITH 007 THANKS ATRIB TEST.dwg Quote
mhupp Posted July 11, 2022 Posted July 11, 2022 (edited) This does a one to one replace of objects. Please note I am only selecting the yellow text. ;;----------------------------------------------------------------------------;; ;; Copy item to Multiple locations to replace selection (defun C:COPYOBJ (/ ent BP SS obj LL UR MPT) (vl-load-com) (setq obj (vlax-ename->vla-object (setq ent (car (entsel "\nObject to copy: "))))) (vla-getboundingbox obj 'minpt 'maxpt) (setq BP (mapcar '/ (mapcar '+ (vlax-safearray->list minpt) (vlax-safearray->list maxpt)) '(2 2 2))) (if (setq SS (ssget)) (foreach e (vl-remove-if 'listp (mapcar 'cadr (ssnamex SS))) (setq obj (vlax-ename->vla-object e)) (vla-getboundingbox obj 'minpt 'maxpt) (setq MPT (mapcar '/ (mapcar '+ (vlax-safearray->list minpt) (vlax-safearray->list maxpt)) '(2 2 2))) (vla-delete obj) (vl-cmdf "_.Copy" ent "" BP "_non" MPT) ) ) (princ) ) Edited July 11, 2022 by mhupp vl-load-com Quote
leonucadomi Posted July 11, 2022 Author Posted July 11, 2022 THANK YOU BUT THE ROUTINE DOES NOT EXECUTE Quote
Steven P Posted July 12, 2022 Posted July 12, 2022 Lee MAcs CTX will also do this though you have to select the text to copy into individually Quote
marko_ribar Posted July 12, 2022 Posted July 12, 2022 Didn't looked at DWG, but according to provided code, I suppose it's designed for copying and replacing normal entities, not specific ones like requested - attributes... So, can you just select, input desired number, and change textstring to all collected through selection... Either way, it's the same... Sometimes it's better to just do input by keyboard through routine runtime, IMHO... Quote
BIGAL Posted July 13, 2022 Posted July 13, 2022 Is there a reason the block does not have just one attdef ? which can be any text rather than using the Tagstring name ? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.