Jump to content
Developer Wiki and Function Reference Links ×

Script make


Recommended Posts

Yes you can have a script that will move objects.

 

What are you trying to do? Do you want to move objects so they fit on the page? Do you care if the relative position of the objects changes? 


Or, do you want to change the scale so the objects fit on the page while still retaining the same relative positions?

 

Both are possible.

Link to comment

No Change in Scale. Just If the object Can move inside the page.

I usually work with solid object like rectangle Frames . 

It would be nice if they can be moved to the center of the page .

If thats not possible well does not matter what position they go inside the page . 

Thanks

Link to comment

Here is a real quick version. It has only been run once, so use at your own risk. Test on a backup before trusting to your real data.

 

Draw a rectangle the size of your page and name it MyPage at the bottom of the OIP.

 

The script will move all objects that are outside of the MyPage object so that the bottom left corner of the bounding box is at the page center.

 

Lots of enhancements possible, but at least you have an outline. 

 

As again if you have more questions.

 

Procedure Test;

Procedure DoIt(H1:Handle);
Var	X1,Y1,X2,Y2:Real;
	Begin
		GetBBox(H1,X1,Y1,X2,Y2);
		HMove(H1,-X1,-Y2);
	End;
	
Begin
	ForEachObject(DoIt,((LOC<>'MyPage')));
End;

Run(Test);

 

Link to comment

The script gets the Bounding Box of the objects and moves the bottom left point of the bounding box to 0,0. So if 0,0 if off you page then the objects will move to off your page.

 

To work on selected objects only, edit the ForEachObject line:

 

ForEachObject(DoIt,(((LOC<>'MyPage') & (VSEL=TRUE))));

 

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