leonucadomi Posted July 11, 2022 Share 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 Link to comment Share on other sites More sharing options...
mhupp Posted July 11, 2022 Share 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 Link to comment Share on other sites More sharing options...
leonucadomi Posted July 11, 2022 Author Share Posted July 11, 2022 THANK YOU BUT THE ROUTINE DOES NOT EXECUTE Quote Link to comment Share on other sites More sharing options...
mhupp Posted July 11, 2022 Share Posted July 11, 2022 Added an a to vl-load-com should work now. 1 Quote Link to comment Share on other sites More sharing options...
Steven P Posted July 12, 2022 Share Posted July 12, 2022 Lee MAcs CTX will also do this though you have to select the text to copy into individually Quote Link to comment Share on other sites More sharing options...
leonucadomi Posted July 12, 2022 Author Share Posted July 12, 2022 thanks its excellent Quote Link to comment Share on other sites More sharing options...
marko_ribar Posted July 12, 2022 Share 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 Link to comment Share on other sites More sharing options...
BIGAL Posted July 13, 2022 Share 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 Link to comment Share on other sites More sharing options...
ILoveMadoka Posted September 8 Share Posted September 8 This is friggin AWESOME!! Quote Link to comment Share on other sites More sharing options...
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.