cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

Macro code / command for fitting elements into drawing

ptc-2173584
1-Newbie

Macro code / command for fitting elements into drawing

Hello, I am looking for a macro code / macro command that has the same purpose like the function "Edit->Move->Fit Elements". I definitly know that the macro command is existing in Arbortext IsoDraw Version 7.0 M040, but has not been published in the macro documentation yet. I think that macro would be very usefull for batch processing.
6 REPLIES 6

If you do not get a reply shortly post again. I have a macro currently that centers all elements within a frame. It could be expanded to also resize. I can send you what I have and you could then work with it for your needs.

I've been playing around with this issue and contacted PTC. I was told there was no macro command for the fit elements command but that it was accessible by the menu command. I am able to get the pop-up menu to appear, but can not figure out if there is a way to click "OK". The two optional with statements do not accomplish this. Any ideas? Macro Fit Menu "Fit Elements..." End Macro

The follwing code will resize your selection to the frame size and center it. Hope this meets your needs or at least gets you close. Macro Resize_to_Frame Define LeftCoord as Float Define RightCoord as Float Define TopCoord as Float Define BottomCoord as Float Define Height as Float Define Width as Float Define ScalePercentage as Float #Groups selection. Group Selection #Determines all sides of grouped art. Create object_Info ActiveDoc.FirstSelectedElement ActiveDoc.FirstSelectedElement.Info.View_Context.type = "extent" Leftcoord = ActiveDoc.FirstSelectedElement.Info.View_Context.Rectangle.Left RightCoord = ActiveDoc.FirstSelectedElement.Info.View_Context.Rectangle.Right TopCoord = ActiveDoc.FirstSelectedElement.Info.View_Context.Rectangle.Top BottomCoord = ActiveDoc.FirstSelectedElement.Info.View_Context.Rectangle.Bottom #Determines height and width of grouped art. Height = TopCoord - BottomCoord Width = RightCoord - LeftCoord #Determines resize scale. If (Height > Width) then ScalePercentage = ActiveDoc.window.pageY/Height Else ScalePercentage = ActiveDoc.window.pageX/Width End If #Scales the grouped art to proper size. Scale Selection LeftCoord BottomCoord ScalePercentage ScalePercentage #Recentered the art. Cut Zoom Page Paste #Clears temp grouping. Ungroup Selection #Clears selection. Select None End Macro

Trevor,

Is there a way to change frame size from the selected elements, like an option available in Adobe illustrator?

thendricks
3-Visitor
(To:mano)

Options:

1) Resize your frame before running the macro.

2) Change Height and Width variables to take input instead of checking the existing frame size.

Hi Trevor,

i was suggesting an option like we select the image, then go to fit elements so the image will come to the frame size. can we do it reverse? like bringing down the frame size from the selected image, that is the frame gets increase or decrease according to the selected image?

Thanks for your reply

Top Tags