Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Scaling between two points WITHIN a group of objects.

New Here ,
Nov 28, 2019 Nov 28, 2019

Hello, can anyone help me with this Illustrator task?

 

I would like to scale this entire set of drawings, using two points WITHIN the group. 

The two points I would like to use are highlights in RED and the final dimension I would like is 150mm wide as this is a scale of 1:10. When I make this change, I would like the rest of the drawing to proportionally scale up too.

 

I know I can draw a box in 150mm behind it, and manually resize the group and use the box behind as a guide, and it will be a roughly correct result, however I am looking for a faster and more accurate workflow as I have many to do.

 

 

Screen Shot 2019-11-29 at 11.14.34 am.png

TOPICS
Draw and design
998
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
LEGEND ,
Nov 29, 2019 Nov 29, 2019

Hotdoors CAD Tools has a bunch of advanced resizing tools and dynamic rulers/ labels.

 

Mylenium

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 30, 2019 Nov 30, 2019

assuming the whole diagram is Grouped, select or draw 1 horizontal line (inside the group), select it and run the script below.

Enter the desire size incuding units and the Parent group of the selected item will be resized.

 

Before 

resizeGroupScript.PNG

After

resizeGroupScript2.PNG

 

// https://community.adobe.com/t5/illustrator/scaling-between-two-points-within-a-group-of-objects/td-p/10769540
// resize Group by selecting 1 horizontal item (directly within the group)
// carlos canto 11/30/19

function main() {
    var idoc = app.activeDocument;
    var sel = idoc.selection;

    if (sel.length == 1) {
        var newWidth = Window.prompt ('Enter Selected item new Width', "ie. 150 mm or 1.5 in or 300 pt", 'Resize Group by Selecting 1 item inside it');
        var myUV = new UnitValue(newWidth);
        
        if (myUV.type == "?") {
            alert("Unknown unit type entered. Enter a valid measurement unit and try again");
            return;
        }
    
        resizeObject (sel[0], myUV.as ('pt'));

        function resizeObject (obj, newWidth) {
            var idoc = app.activeDocument;
            var parentGroup = obj.parent;

            var currentWidth = obj.width;
            
            var perCent = newWidth/currentWidth*100;

            var scaleMatrix = app.getScaleMatrix(perCent, perCent);
            parentGroup.transform (scaleMatrix, true, true, true, true, perCent/100, Transformation.CENTER); // scale strokes
        }
    }
    else {
        alert('select 1 Horizontal item (within a group) and try again');
    }
}

main();
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 01, 2019 Dec 01, 2019

Hi Carlos, 

 

Thank you very much! It is very kind of you to take the time to help.

 

I have zero experience scripting. I have created a copy of an Illustrator 2019 sample script, and replaced with your code. Would you mind reviewing where I am going wrong?Screen Shot 2019-12-02 at 9.03.00 am.pngScreen Shot 2019-12-02 at 9.03.09 am.png 

 

Warm regards,
Anna

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 01, 2019 Dec 01, 2019

Hi annarees, delete line 17, that should take care of the problem.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 01, 2019 Dec 01, 2019

Hi Carlos, 


You are my hero. Thank you! It works perfectly now!

 

Best wishes,

Anna

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 01, 2019 Dec 01, 2019

my pleasure 🙂

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 01, 2019 Dec 01, 2019

what are those, IKEA manuals?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 01, 2019 Dec 01, 2019
Something like that! Much better than IKEA.

Anna Rees
Creative Director BFA (Elam)
THE ENGLISH TAPWARE COMPANY
T: +61 3 9818 1403 | M: +61 450 697 662
Anna@englishtapware.com.au | www.englishtapware.com.au
751 High Street, Armadale, VIC3143,Australia
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 01, 2019 Dec 01, 2019
LATEST

thanks, it does look nice. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines