itacad Posted October 9 Share Posted October 9 Hi, very often I have to do some searches with Find, at the end and exit from the command I get a selection of objects Found. I ask if there is a method (or a lisp) to copy above each selected object, an object already present in the drawing. For example, I would like to: - copy a speech bubble (revision speech bubble) over the objects, or - copy a block specially prepared for tagging over the objects, or - copy a text to communicate information over the objects, or - copy a polyline with counting symbols, or - etc.... Of course, there is no need for perfect overlapping, it is fine to obtain the "insertion point above insertion point" copy and then manually refine the position. The object to be copied obviously would be previously prepared and ready to be selected in the file itself. Greetings Quote Link to comment Share on other sites More sharing options...
fuccaro Posted October 9 Share Posted October 9 That should not cause much headache. (defun c:pp() (setq el (entget (car (entsel "What to copy? "))) el (subst (assoc 10 (entget (car (entsel " And where to copy that?")))) (assoc 10 el) el)) (entmake el) (princ) ) it will copy blocks, texts and lot more kind of objects over the geometry you select. It will superpose their insertion points. Quote Link to comment Share on other sites More sharing options...
fuccaro Posted Thursday at 04:51 AM Share Posted Thursday at 04:51 AM In the Lisp above you pick one by one the objects to get something copied on top. Reading again I just realize that you wish to insert something over the objects already selected. Sorry, here is an other Lisp I think better suits your needs. (defun c:pp() (setq what (entget (car (entsel "\t what to copy? "))) a10 (assoc 10 what)) (setq p (cadr (ssgetfirst))) (repeat (setq i (sslength p)) (entmake (subst (assoc 10 (entget (ssname p (setq i (1- i))))) a10 what)) ) (setq p nil) ) Quote Link to comment Share on other sites More sharing options...
itacad Posted Thursday at 05:12 AM Author Share Posted Thursday at 05:12 AM Good morning fuccaro and in the meantime thanks for the help. It doesn't seem to me that lisp works, to the question what to copy? whatever type of object I select I get an error error: wrong argument type: lselsetp nil Secondly, as explained to me, I need to solve it in another way. 1) I conclude a search or a multiple selection of objects that are therefore already selected 2) At this point I would like to call your command that should only ask me what to copy, letting me select the type of object (cloud, text, line, block...) 3) ...at that point the copy of the selected object should occur over the preselected objects... "pickfirst" type of operation therefore... thanks again Quote Link to comment Share on other sites More sharing options...
fuccaro Posted Thursday at 10:36 AM Share Posted Thursday at 10:36 AM Please try this one: (defun c:pp( / a10 what p i ss) (setq what (entget (car (entsel "\t what to copy? "))) a10 (assoc 10 what)) (setq p (cadr (setq ss(ssgetfirst)))) (repeat (setq i (sslength p)) (entmake (subst (assoc 10 (entget (ssname p (setq i (1- i))))) a10 what)) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
fuccaro Posted Thursday at 10:44 AM Share Posted Thursday at 10:44 AM pp.mp4 Quote Link to comment Share on other sites More sharing options...
itacad Posted Thursday at 10:49 AM Author Share Posted Thursday at 10:49 AM Sorry so much! I was still pointing to the previous lisp! With texts and blocks I tried it and it works and I'll start using it right away! thanks! Quote Link to comment Share on other sites More sharing options...
fuccaro Posted Thursday at 10:52 AM Share Posted Thursday at 10:52 AM Glad to be helped, @itacad Quote Link to comment Share on other sites More sharing options...
fuccaro Posted Thursday at 05:59 PM Share Posted Thursday at 05:59 PM @itacad please use the last Lisp i posted here. That's the only one destroying the selection set. Using alot the previous routine wil lead to bad memory management. Quote Link to comment Share on other sites More sharing options...
itacad Posted Friday at 06:22 AM Author Share Posted Friday at 06:22 AM OK! thanks! 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.