MarcoW Posted September 19, 2011 Posted September 19, 2011 I wonder if this is possible, and if so, how to approach this. At one point I want to give a command like "START" and after some time I will give the command "STOP". Every item (lines, plines, text, blocks etc.) that was created between "START" and "STOP" should be added to a selection set. I guess this should be done with a reactor? Any help is much appreciated! BTW I am not asking for you guys to program, I just need some hints, links or maybe small pieces of code to get started. Quote
Tharwat Posted September 19, 2011 Posted September 19, 2011 Hi marco . You can add the previous created object by the use of function ssadd to add to the current selection set . Example . (setq ss (ssadd)) (command "_.line" '(0. 0. 0.) '(1. 0. 0.) "") (ssadd (entlast) ss) And so on .... Hope this what you mean Tharwat Quote
jammie Posted September 19, 2011 Posted September 19, 2011 Hi MarcoW, Consider marking the last entity (entlast) in the drawing before running your command. When your command finishes loop through the database from that enity (entnext ) & add each ename to the selection as per Tharwat's suggestion Jammie Quote
MarcoW Posted September 19, 2011 Author Posted September 19, 2011 @ Tharwat & Jammie: Thanks for the replies! However that information is kinda what I allready know :-). I am sorry for my bad explaining of my goal... I'll try again. After command "START" I will draw lines, circles, blocks, text and anything I need to in order to make my drawing. When giving command "STOP" I need to have all the created objects in a selection set so I can copy them by lisp. Your given solution will only work if the (ssadd) function is added to each command seperately. Because I don't know when "START"ing and when to "STOP" I think this can only be achieved with the use of a reactor. Quote
David Bethel Posted September 19, 2011 Posted September 19, 2011 Record your start entity with: (setq fe (entlast)) Create en empty selection set: (setq ss (ssadd)) Fill the selection set with the new entities after the stop entity is made: (while fe (ssadd fe ss) (setq fe (entnext fe))) Remember to not overwrite fe or ss during the process. -David Quote
MarcoW Posted September 19, 2011 Author Posted September 19, 2011 @ David: Just tried it quickly and now I get it, I even get it to do what I want... let me do some experimenting :-) @ Tharwat & Jammie: that means that you did try to put my into the right tdirection but I was not listening :-{ good enough. Thanks all for keeping me from boredom :-) Quote
MarcoW Posted September 19, 2011 Author Posted September 19, 2011 Oops I forgot to ask: This: (setq fe (entlast)) will add the last entity, created before the start command, into the selectionset. How to go about it so that last item is "skipped"? Quote
jammie Posted September 19, 2011 Posted September 19, 2011 Your welcome MarcoW, Just working with David Bethel's code for filling the selection set (while (setq fe (entnext fe)) (ssadd fe ss) ) This will add all items to the selection set after the initial marker is defined Regards Jammie Quote
MarcoW Posted September 19, 2011 Author Posted September 19, 2011 Thanks! I Will have a go tomorrow at THE office 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.