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

Place Legend based on Art not x y Coordinates

Engaged ,
Nov 12, 2018 Nov 12, 2018

Copy link to clipboard

Copied

Hello,

Is there a script out there that I have not been able to find that will allow you to place a Symbol, Centered and slightly below in relation to the selected art?  Everything that I have tried places the Symbol based on x y coordinates.

Thank you!

TOPICS
Scripting

Views

337

Translate

Translate

Report

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
Engaged ,
Nov 12, 2018 Nov 12, 2018

Copy link to clipboard

Copied

What about this script by Jet?

  1. /*
  2. JET_ReplaceWithSymbol.jsx
  3. A Javascript for Adobe Illustrator
  4. Purpose: Replaces selected items with Instances of a Symbol from the Symbols Panel.
  5. The desired Symbol can be defined by its index number (its number of occurrance in the Panel).
  6. */ 
  7. var docRef=app.activeDocument; 
  8. var symbolNum=prompt("Enter the number of the Symbol you want to replace each selected object",1); 
  9. for(i=0;i<docRef.selection.length;i++){ 
  10.           var currObj=docRef.selection
  11.           var currLeft=currObj.left; 
  12.           var currTop=currObj.top; 
  13.           var currWidth=currObj.width; 
  14.           var currHeight=currObj.height; 
  15.           var currInstance=docRef.symbolItems.add(docRef.symbols[symbolNum-1]); 
  16.           currInstance.width*=currHeight/currInstance.height; 
  17.           currInstance.height=currHeight; 
  18.           currInstance.left=currLeft; 
  19.           currInstance.top=currTop; 
  20.           currInstance.selected=true
  21.           currObj.remove(); 
  22.           redraw(); 
  23. }

Votes

Translate

Translate

Report

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
Engaged ,
Nov 12, 2018 Nov 12, 2018

Copy link to clipboard

Copied

I'm not sure on this one because I am not replacing anything.

The most important thing is that the "ART" not move at all.

Right now I am Placing the Symbol (Generic Cyan Shape)

Selecting Both

Clicking on the "ART" so that I can center to that object

Center Horizontally

Align Bottom

Then with the Symbol Selected I am doing a "Transform Each" with the below settings twice.

Votes

Translate

Translate

Report

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
Advocate ,
Nov 13, 2018 Nov 13, 2018

Copy link to clipboard

Copied

LATEST

Salut !

// JavaScript Document for Illustrator

var space = 10;  // pt

var symbIndex = 0;

function slign(dec,index) {

  var  currObj, VBounds, currInstance;

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

      currObj =selection;

      VBounds =currObj.visibleBounds;

      currInstance= activeDocument.symbolItems.add(activeDocument.symbols[index]);

      currInstance.position = [(VBounds[0]+VBounds[2])/2-currInstance.width/2,VBounds[3]-dec];

    }

}

if (app.documents.length) {

  slign(space,symbIndex);

}

de LR elleere

Votes

Translate

Translate

Report

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