Alexandre Villares Posted July 23, 2002 Share Posted July 23, 2002 Is there a simple way of moving or duplicating objects to a different layer? Am I missing something obvious? I'm feeling very stupid about this. Any help is welcome. Quote Link to comment
MullinRJ Posted July 23, 2002 Share Posted July 23, 2002 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) . 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 } Quote Link to comment
MullinRJ Posted July 23, 2002 Share Posted July 23, 2002 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 } Quote Link to comment
Alexandre Villares Posted July 23, 2002 Author Share Posted July 23, 2002 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 ] Quote Link to comment
MullinRJ Posted July 24, 2002 Share Posted July 24, 2002 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 Quote Link to comment
Guest Posted July 24, 2002 Share Posted July 24, 2002 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. Quote Link to comment
MullinRJ Posted July 25, 2002 Share Posted July 25, 2002 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 Quote Link to comment
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.