Jump to content
Developer Wiki and Function Reference Links ×

to change objects from one layer to another


Recommended Posts

This procedure will copy all objects from a specified layer to the active layer. It should be easy to adapt it to copy selected objects from the active layer to any target layer (ie - Procedure PutStuff(Lyr :String) wink.gif" border="0 .

HTH,Raymond

Procedure GetStuff(Lyr :String); { Copy all objects from layer = "Lyr" to the active layer. } VAR LName :String; Begin LName := GetLName(ActLayer); { Get active layer name } Layer(Lyr); { Make "Lyr" the active layer } SelectAll; DoMenuTextByName('Copy', 0); Layer(LName); { return to previous active layer "LName" } DoMenuTextByName('Paste In Place', 0); End; { GetStuff }

Link to comment

OK, I had a few minutes free time and it's not 4 AM, so I can think straight. Here is a PutStuff script. One note of caution, if an object is locked, Cut will do nothing.

HTH,Raymond

Procedure PutStuff(Lyr :String; MoveObjs :Boolean); { Copy or Move all selected objects from the active layer to layer = "Lyr". } { If MoveObjs is TRUE, Objects are moved by Cut and Paste. } { If MoveObjs is FALSE, Objects are duplicated by Copy and Paste. } VAR LName :String; Begin LName := GetLName(ActLayer); { Get active layer name } if MoveObjs then DoMenuTextByName('Cut', 0) else DoMenuTextByName('Copy', 0); Layer(Lyr); { Make "Lyr" the active layer } DoMenuTextByName('Paste In Place', 0); Layer(LName); { return to previous active layer "LName" } End; { PutStuff }

Link to comment

Thanks a lot Raymond! Your code will help me incredibly.

I had Cut & Paste in mind, but I find it rather disturbing that there is no other way.

I mean, manualy it's a simple Obj. Info. Palette thing and VS-wise Layers are sort of the 'ultimate containers' ... I guess it's some minimalist prejudice I've got.

Thanks anyway!

[ 07-23-2002: Message edited by: Alexandre B A Villares ]

Link to comment

I never did understand why there have not been Copy; Paste; & PasteInPlace; commands in VS. And for that matter, SendToLayer would be nice, too. In some of the documentation I have read over the years, the use of DoMenuText() commands was discouraged for portability reasons, but I know of no other way to invoke these basic functions. It seems to me the above commands would be a logical extension of the VS interface, and it would make it a whole heck of a lot easier for NOVICE programmers to get started. That's just my 2?. Glad I could help.

Raymond

Link to comment

Right you are Ray, but there is another factor that we, as users don't see, which is the difficulty of implementation. Generally, when I see reluctance to implement certain obvious calls, I've come to understand that there is usually a technical obstacle that makes it not worth doing compared to other jobs. Sometimes, a development comes along that makes it possible to implement a long-standing wish list feature. Unfortunately, we are not privy to this aspect.

Link to comment

Although, I agree with you in principle, that implementaion of something simple is never simple, I can't help but wonder that these aspects could not have been implemented in more than a decade of development. You and I can work around it, but ease of use should be a goal, not a Wish List item.

Raymond

Link to comment

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