josue Corona Posted June 6, 2019 Share Posted June 6, 2019 Is there a way to make a script that when I have object in my design layer . they can all move inside the paper space center . thank you in advance for anyone that knows if thats possible. thanks. Quote Link to comment
Pat Stanford Posted June 6, 2019 Share Posted June 6, 2019 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. Quote Link to comment
josue Corona Posted June 6, 2019 Author Share Posted June 6, 2019 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 Quote Link to comment
Pat Stanford Posted June 6, 2019 Share Posted June 6, 2019 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); Quote Link to comment
josue Corona Posted June 6, 2019 Author Share Posted June 6, 2019 Thank you very much it works. Quote Link to comment
josue Corona Posted June 6, 2019 Author Share Posted June 6, 2019 Hello at first I thought it was going at the origin of the x,y so I moved the origin to the center of the page . but the objects move to the side of the page nowhere inside . Quote Link to comment
josue Corona Posted June 6, 2019 Author Share Posted June 6, 2019 that the location the where the circle is going to. Quote Link to comment
josue Corona Posted June 6, 2019 Author Share Posted June 6, 2019 I notice if I have multiple objects all of them automatically move there . can it be just for selected object to do the move? thanks. Quote Link to comment
josue Corona Posted June 6, 2019 Author Share Posted June 6, 2019 Sorry I did say all objects when asking for a script, I was not thinking . I would like it to be for selected objects . thanks Quote Link to comment
Pat Stanford Posted June 6, 2019 Share Posted June 6, 2019 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)))); Quote Link to comment
josue Corona Posted June 6, 2019 Author Share Posted June 6, 2019 I see the Orig is off my page . is there a page to move it? Quote Link to comment
josue Corona Posted June 6, 2019 Author Share Posted June 6, 2019 I just figured it how thanks Quote Link to comment
josue Corona Posted June 6, 2019 Author Share Posted June 6, 2019 This script works perfect . another thing since I usually work with squares can the move location be from the center of my object . if not its alright. This script is already working good 😄 Quote Link to comment
Pat Stanford Posted June 6, 2019 Share Posted June 6, 2019 Untested but change the Hmove line to: HMove(H1,-(X1+X2)/2,-(Y1+Y2)/2); Quote Link to comment
josue Corona Posted June 6, 2019 Author Share Posted June 6, 2019 Nice!!!!! It work thank you. . I would like to learn on how to script, but I don't even know how to start a script . for example I simple rectangle I don't even know how to start a rectangle . are there any tips on how start any procedure ? thank you Quote Link to comment
josue Corona Posted June 6, 2019 Author Share Posted June 6, 2019 where I work. they have this script of a frame that already has multiple functions it can be change size and it can be made out of alluminum or plywood. but I want to start learning script so I can tweak it little bit like make drill hole anywhere on the frame . Quote Link to comment
josue Corona Posted June 6, 2019 Author Share Posted June 6, 2019 I know this will take a long time to make it work so I wanna start basic with a rectangle . Quote Link to comment
josue Corona Posted June 6, 2019 Author Share Posted June 6, 2019 its a 3d Object frame scripts 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.