chavlji Posted March 6, 2009 Share Posted March 6, 2009 Hello I have a list of POINTS where I should copy SelectionSet. I've decided for COPY command (CopyClip does not work in refeditor). COPY command asks you for points of destination points until user hits ENTER instead of point. Now I just dont know how to combine Copy and List of points... Let the code speaks: ;We construct a list of points: (vlax-foreach item Items (setq DestPoints (cons (GetPoint Item) DestPoints)) ;And now we would like to copy SS to each point from DestPoints: (command "COPY" SS "" SourcePoint DestPoints "") This code returns error, because DestPoints list is not point. It is list of points, but Autocad does not understand, that it should take each item from this list out... how to tell it? Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted March 6, 2009 Share Posted March 6, 2009 Perhaps: (vlax-foreach item Items (setq DestPoints (cons (GetPoint Item) DestPoints)) (mapcar '(lambda (x) (command "_copy" ss "" SourcePoint x)) DestPoints) Quote Link to comment Share on other sites More sharing options...
chavlji Posted March 6, 2009 Author Share Posted March 6, 2009 Yes, It works, but I would rather call COPY command only one time... it would be much faster than calling it n times. That's why I'm even creating a list first and then I would like to do all the copying at once, in one command. So that is not exactly what I was looking for... Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted March 6, 2009 Share Posted March 6, 2009 Well, in the OP it said nothing about the number of times "copy" was called... You have gone from not knowing how to tell ACAD to copy something to wanting it to do it in a way which I doubt is possible. Quote Link to comment Share on other sites More sharing options...
chavlji Posted March 7, 2009 Author Share Posted March 7, 2009 I thought It is possible somehow and wanted to learn how... I solved it your way. It works, not super fast but it does. Thenx Quote Link to comment Share on other sites More sharing options...
David Bethel Posted March 7, 2009 Share Posted March 7, 2009 This should work: [b][color=BLACK]([/color][/b]command [color=#2f4f4f]"_.COPY"[/color] ss [color=#2f4f4f]""[/color] [color=#2f4f4f]"_M"[/color] SourcePoint[b][color=BLACK])[/color][/b] [b][color=BLACK]([/color][/b]foreach p Destpoints [b][color=FUCHSIA]([/color][/b]command p[b][color=FUCHSIA])[/color][/b][b][color=BLACK])[/color][/b] [b][color=BLACK]([/color][/b]command [color=#2f4f4f]""[/color][b][color=BLACK])[/color][/b] -David Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted March 7, 2009 Share Posted March 7, 2009 Ahh nice one David - I take back what I said about it not being possible - I completely forgot about the "multiple" option. Quote Link to comment Share on other sites More sharing options...
chavlji Posted March 7, 2009 Author Share Posted March 7, 2009 Huh! Thanks!!! You learn something new each day 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.