Jump to content
Developer Wiki and Function Reference Links ×

Script/tool request: Cut/Copy-Paste from outside symbol to same place


Recommended Posts

Right now when cut/copy-paste an object from a symbol to outside the symbol using 'Edit > Paste in Place' it places the object on the coordinates from the symbol. Instead of exact the same place but then outside the symbol. I'm looking for a way to easily add or remove objects form a 2d/3d symbol without the position of that objects changes. Like when you cut/copy-paste an object outside a group.
 

Is this something that a script can do? Can this be a command? (imho the easiest way) Or will this be a tool? (to click which objects to add/remove?)

 

This is something I really miss compared to SketchUp. I think this will improve anyones workflow a lot. Any help making this function a reality is really appreciated.

 

 

Some screenshot for explanation

1. Cut object

2. Paste in Place object places at coordinates as it was in the symbol. I would want it to be placed at same position but then outside the symbol

Cut.JPG.b600907c6eb85818cb04d6dc14f77011.JPGPaste.JPG.35ad6fcf30dc8379eb83493b8eb79077.JPG

Edited by MarcelP102
Link to comment
  • MarcelP102 changed the title to Script/tool request: Cut/Copy-Paste from outside symbol to same place
  • Vectorworks, Inc Employee

The attached file contains two scripts that will do this – one for Cut and one for Copy. The scripts could easily be converted to menu commands and will only work if the symbol is selected then edited from the active layer by double clicking or via a keyboard shortcut. They won't work for a symbol edited from say the Resource Manager and might not work if you are within a group within a symbol. I wrote these just now while watching the footy so testing has been very limited. Use discretion until you have confidence they work as expected.

 

Copy From Symbol Paste in Place.vwx

  • Like 1
Link to comment
  • 3 months later...
  • Vectorworks, Inc Employee

Rotated Plan View (RPV) is tricky to deal with - at least it was the last time I tried.

GetPref(92) will tell you if the plan is rotated and GetPrefReal(93) will give you the angle, however both of these are read only. If they weren't, you would load the angle into a variable, set it to zero, do your copying and pasting, then restore the RPV.

 

Something like this might work:

 

bRPV := GetPref(92);

IF bRPV THEN BEGIN

    VSave('_Random_');
    SetView(0, 0, 0, 0, 0, 0);

END;


{ your code }

 

IF bRPV THEN BEGIN
    VRestore('_Random_');
    VDelete('_Random_');

END;

 

however using SetView() to establish Top/Plan may be fraught. Perhaps someone else will have a better idea for that. 

Link to comment

To test for Top/Plan before you use SetView(), check that Projection = 6.

 

IsView2D := GetProjection(ActLayer) = 6;    { TRUE if view is TopPlan }

 

To reset TopPlan after messing with SetView(), use:

 

if IsView2D then begin

       SetView (0,0,0,   0,0,0);                   { Top view } 

       Projection(6, 0, 10, -2, -2, 2, 2);    { TopPlan }

end;

 

Raymond

Edited by MullinRJ
logic error
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...