Skip to main content
orbitalic
Participant
June 10, 2019
Answered

Script: move selected anchors at isometric degree (-30 or 30)

  • June 10, 2019
  • 4 replies
  • 1807 views

I wonder is there any simple way to extend length of an isometric shape?

For example I have a cube and want to make it a parallelepiped (from 3d square -> 3d rectangle). So I usually grab all anchors and then press enter and write -30 on angle input and adjust distance. Its not that hard, but angle has always different random  values when I click enter, so I need to delete it and put -30 or 30 every time manually, which is frustrating  a bit.

Is there any way to make action or script to make this process easier?

Will appreciate any help.

This topic has been closed for replies.
Correct answer renél80416020

Salut!

Si j'ai bien compris, peut-être ce petit script rapide ?:

Je peux mieux faire avec:

https://share.orange.fr/#rjKo0JQjt92a0dbb711b

// JavaScript Document for Illustrator

// Si on admet que les points sont de type CORNER ou presque

//INIT--------

var a = 30;  //degrés

var d = 60;  //points

//-----------

var def = prompt("Déplacement en pts,angle en degrés?",d+","+a);

if (def != null && def != "") {

var def = def.split(",");

    d = def[0];

      if(def.length > 1) a = def[1];

   var dr = Math.PI/180;

   var sel = selection;

   var p, anc, newAnc;

    for (var k = 0; k < sel.length; k++) {

      for (var i = 0; i < sel.pathPoints.length; i++) {

       p = sel.pathPoints;

        if (p.selected == PathPointSelection.ANCHORPOINT) {

          anc = p.anchor;

          newAnc = [anc[0]+d*Math.cos(a*dr),anc[1]+d*Math.sin(a*dr)]

          p.anchor = newAnc;

          p.leftDirection  = newAnc;

          p.rightDirection = newAnc;

        }

      }

    }

  }

4 replies

renél80416020
renél80416020Correct answer
Inspiring
June 17, 2019

Salut!

Si j'ai bien compris, peut-être ce petit script rapide ?:

Je peux mieux faire avec:

https://share.orange.fr/#rjKo0JQjt92a0dbb711b

// JavaScript Document for Illustrator

// Si on admet que les points sont de type CORNER ou presque

//INIT--------

var a = 30;  //degrés

var d = 60;  //points

//-----------

var def = prompt("Déplacement en pts,angle en degrés?",d+","+a);

if (def != null && def != "") {

var def = def.split(",");

    d = def[0];

      if(def.length > 1) a = def[1];

   var dr = Math.PI/180;

   var sel = selection;

   var p, anc, newAnc;

    for (var k = 0; k < sel.length; k++) {

      for (var i = 0; i < sel.pathPoints.length; i++) {

       p = sel.pathPoints;

        if (p.selected == PathPointSelection.ANCHORPOINT) {

          anc = p.anchor;

          newAnc = [anc[0]+d*Math.cos(a*dr),anc[1]+d*Math.sin(a*dr)]

          p.anchor = newAnc;

          p.leftDirection  = newAnc;

          p.rightDirection = newAnc;

        }

      }

    }

  }

orbitalic
orbitalicAuthor
Participant
June 22, 2019

Bon jour! Merci beaucoup!

This is great!

JETalmage
Inspiring
June 11, 2019
  1. White Pointer: Select a node.
  2. Actions Palette: New Action named "Move_30°". Start Recording.
  3. Tap Enter to invoke the Move dialog. Settings: 30°, Distance: 1. Tap Enter.
  4. Tap Enter to invoke the Move dialog. Settings: 30°, Distance: -1. Tap Enter.
  5. Stop Recording.

Now, whenever you want to move a set of nodes of your cube:

  1. Play the Action. You'll see the selection "wiggle" along the 30° axis, visually verifying the angle of movement (kinda neat) but it will be returned to its original position.
  2. Tap Enter. The Move dialog will have been pre-set to that angle.
  3. Just key in the desired distance.

Create similar Actions for the other two axes. The three Actions will serve to pre-set the Move dialog to the desired axis angle with one click.

JET

orbitalic
orbitalicAuthor
Participant
June 15, 2019

JET, wow, that's creative. Thanks you for answer! Yet this is not as easy as we could imagine, it probably 1 step easier than manually input.

Maybe in 10 years update, the adobe will make some new hot instruments for convenient isometric design.

JETalmage
Inspiring
June 17, 2019
Maybe in 10 years update, the adobe will make some new hot instruments for convenient isometric design.

Why wait for Adobe? Corel Technical Designer has features specifically intended for axonometric illustration (of which isometric is just a special case). So does Affinity Designer. Corel just added some enhancements in its 2019 version to better facilitate re-orientation of the planes for "off-axis" construction. Affinity's feature is also steadily undergoing improvement (and costs much less).

Such approaches are usually based on grids which, frankly, I'm not fond of because there are better ways to build an interface for axonometric drawing. (In the 40-plus years I've been doing isometric drawing in industry, I've never met a fellow technical illustrator who was dependent upon grids; neither before nor after the advent of desktop computers.) The improvements in Tech Designer 2019 are at least welcomed "baby steps" away from the grids fixation.

For trivial isometric, in Illustrator, you can move a selection of nodes along your axes by turning on Smart Guides. Set its prefs to include Construction Guides at 30° Angles. Turn on Transform Tools and Measurement Labels (assuming you are using full measure scale along axes, which I don't). When moving multiple selected nodes at once, you may need to press Ctrl (on Windows) for the Construction Guides to display. (Required in version CS6. I can't speak to whether this has changed in Captive Customer versions, because I don't rent software.)

Even without expressly "isometric" features, axonometric drawing can be done in most any decent vector drawing program by those who understand its principles. (I call myself writing a book. It's a labor of love.)

JET

Peter Villevoye
Community Expert
Community Expert
June 10, 2019

Maybe setting the Constraint angle in the General Preferences might help a bit while moving anchors manually in one direction (30 or -30 degrees) ?

orbitalic
orbitalicAuthor
Participant
June 11, 2019

when I move multiple anchors alignment doesn't work. For 1 anchor - yes, I use it.

Jacob Bugge
Community Expert
Community Expert
June 10, 2019

airsky,

You may wish to ask in the Scripting forum,

Illustrator Scripting

orbitalic
orbitalicAuthor
Participant
June 11, 2019

is there a way to move current topic to that section? Or should I start  a new one?

Jacob Bugge
Community Expert
Community Expert
June 11, 2019

airsky,

I have just asked for a moderator to make the move. It is better to avoid an abandoned thread where others may keep posting.