Jump to content

COPY Command and list of points ?


chavlji

Recommended Posts

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?

Link to comment
Share on other sites

Perhaps:

 

(vlax-foreach item Items (setq DestPoints (cons (GetPoint Item) DestPoints))
(mapcar '(lambda (x) (command "_copy" ss "" SourcePoint x)) DestPoints)

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...