graphic objects custom-is it possible?

The task is to create my own map in illustrator which will interact with spreadsheets similar to existing graphics from Illustrator.  Is this possible?  Looks like an excersise script to set basic objects and layout settings, then one of these parameters (in this case a diameter) a link to an excel file prepared with measures unique-number of pixels.  A key element is that the table should be updated in the database is changed.

Any ideas?

Isn't fun script. It was a breeze (well - sort) to get something running for InDesign & top... Now translate into very different Javascript for Illustrator has proved more difficult than I thought!

(There no way to align text vertically within its framework? It is now-of the sort, but it depends on the number of lines of text...)

Type (or copy or import) your values in a new block of text. Separate the label and the value in a single tab. The values will be sorted automatically, and the greatest value will appear in the middle. the rest will be distributed nicely around the edge. I noticed my mathematical distribution isn't exactly the same as the sample you provided... even when you allow for a pixel here or there. I wonder why?

For better or for worse, this is what it produces - the first tiebreaker will always be at an angle of 45 degrees, the rest is separated from each other by an exact distance of 5 points.

and here's the script:

//DESCRIPTION:Krazy Circular Diagrams
// A Jongware Script 24-Sep-2010

// Uses a tab-separated set of String / value data
// which ought to be selected when running the script.
// Use but do not abuse, please.

if (app.documents.length == 0 || app.selection.length != 1 || !(app.selection[0].hasOwnProperty("baseline") || app.selection[0].hasOwnProperty("contents")))
{
     alert ("Please select the text frame containing data");
} else
{
     var dataArray;
     var resultGroup;

     var parent_diameter = 100;
     var parent_position_x = app.activeDocument.activeView.centerPoint[0];
     var parent_position_y = app.activeDocument.activeView.centerPoint[1];

     var black = new GrayColor(); black.gray = 100;
     var white = new GrayColor(); white.gray = 0;

     dataArray = gatherValues(app.selection[0]);
     if (dataArray.length == 0)
          alert ("Unable to get sensible values .. please check");
     else
     {
          calculateValues ();
          resultGroup = app.activeDocument.groupItems.add();
          drawCircles(resultGroup);
     }
}

function gatherValues (fromItem)
{
     var result = new Array();
     var l, line, lines, dataSource;

     if (fromItem.hasOwnProperty("baseline"))
          dataSource = fromItem.parentStory.contents;
     else
          dataSource = fromItem.contents;

     lines = dataSource.split ("\r");

     for (l=0; l position of center of B (anywhere)
          // oh, and distance from parent_center to child_center B is the same as to child_center A!
          // checking on Wikipedia, http://en.wikipedia.org/wiki/Law_of_sines
          // yields something like this ...

               angle_diff = Math.asin ( ((dataArray[nextCircle+1][2]/2 + 5 + dataArray[nextCircle][2]/2)/2) / centerDistance);     // in Radians
               angle_diff = 2*angle_diff * 180 / Math.PI;     // in Degrees
               circleAngle = circleAngle - angle_diff;
          }
     }
}

function drawCircleAt (group, xpos, ypos, textAndSize, color, lineto_x, lineto_y, parentRad, angle)
{
     var tframe, line;

//     The connexion line, if any
     if (lineto_x != undefined && lineto_y != undefined && parentRad != undefined)
     {
          angle = Math.PI * angle / 180.0;

          line = group.pathItems.add();
          line.setEntirePath ( [[lineto_x + parentRad*Math.cos(angle),lineto_y + parentRad*Math.sin(angle)], [xpos - textAndSize[2]/2*Math.cos(angle),ypos - textAndSize[2]/2*Math.sin(angle)]]);
          line.filled = false;
          line.stroked = true;
          line.strokeWidth = 0.5;
          line.strokeColor = black;
     }

//     The Circle
     circle = group.pathItems.ellipse (ypos+textAndSize[2]/2, xpos-textAndSize[2]/2, textAndSize[2], textAndSize[2]);
     circle.strokeColor = black;
     circle.strokeWidth = 0.5;
     circle.fillColor = color;

//     The Text Frame
     tframe = app.activeDocument.pathItems.rectangle(ypos+textAndSize[2]/6, xpos-textAndSize[2]/2, textAndSize[2], textAndSize[2]/2);
     tframe = group.textFrames.areaText(tframe);
     tframe.contents = textAndSize[0];
     tframe.wrapInside = false;
     tframe.wrapped = false;
     tframe.textRange.hyphenation = false;
     tframe.textRange.justification = Justification.CENTER;
     tframe.textRange.textFont = app.textFonts.getByName("MyriadPro-Regular");
     tframe.textRange.characterAttributes.size = textAndSize[2]/6;
     tframe.textRange.fillColor = white;

}

function sortByValue (a,b)
{
     a = Number(a[1]);
     b = Number(b[1]);
     return (a == b) ? 0 : (a < b ? 1 : -1);
}

Tags: Illustrator

Similar Questions

  • I want to send an email manually with the fields email drives custom object? Is this possible?

    I want to send an email manually with the fields email drives custom object? Is this possible?

    Hey,.

    Yes, however, the object record Email custom fields only fill with default values. For the custom field object Record is filled, it must be sent via the event Actions or a generating program so that he knows in which case it is associated.

    Thank you...

  • Can RuntimeStore store share some objects customed between applications?

    Hello

    I know that one application, we can use RuntimeStore to share information, including objects customed.

    What happens if sharing objects across applicatioins customed?

    Here is my scenario:

    1. two applications, app1 and app2.

    2. start app1. He puts some customed objects in RuntimeStore.

    3. run app2. It attempts to retrieve the objects of app1.

    I found this app2 cannot convert object type in type customed as defined in app1, but can convert to some standard objects BB, for example the screen.

    So is it possible to share objects between applications customed?

    You have a library that share the two applications?

    If you then set the store TIME object in the library. If you have not then you need create a library and create the class in the library for applications to use.

  • Can I modify a graphic object for example drawCircle?

    I have a Sprite in which I drew a circle with a fill.  Later, I would like to change the color of the circle.  I have retrieved the Graphics of the Sprite object using getChildAt() and tried:

    getChildAt (i).graphics.beginFill (0 x 550000);

    However, this does not work.

    Is this possible?  I have RTFM but can not know exactly how to deal with the Graphics object.

    Thank you!

    you need to re - draw the circle.

    sp.graphics.beginFill (0 x 550000);

    sp.graphics.drawCircle(x,y,rad);   //<--assign>

    sp.graphics.endFill)

  • Invert the colors of a graphic object?

    Hello, I use the graphics of the image object to draw lines/rectangles etc...

    How to invert the colors of the graphics object?

    Change the blendMode to BlendMode.Invert affect the image (what there are none) not the graphics object.

    You can set a ColorTransform (-1, -1, -1, 1, 255, 255, 255, 0);

    I'll probably get to test this a bit more later, but I think that should reverse the colors in the image...

  • It is better to have graphical objects superimposed on the images?

    Hi, I have a doubt as to the best practice to prepare a file for printing.

    This file will be exported to PDF / X - 1a: 2001 and I wonder if there is any problem with the graphic object (especially dark) with the tangent of one side to an image.

    Is probably a silly question, but I would like to know from your experience, which is the best way to do it.

    Is he better have the overlay for images, or enough of the rectangle is dark align the two borders on the same principle?

    Rectangle and the image isn't any style.

    Thanks in advance!

    indesign-forum.png

    Maybe I understood you.

    Of course, the image must be more large that part which is masking the image, so you can adjust it in InDesign and you should have the material to make changes in the presentation.

    But that you shouldn't do, cover images with white frames to make them invisble.

  • to get the id of the page containing the graphic object

    How can we get the id of the page the file FrameMaker containing the graphic object using the FrameMaker API?

    For example: If there are four body pages in a file with the third page containing a graphical object. How can I get the id of page 3?

    Hi Asha,

    If FP_FrameParent is to give you the frame of the page, then I think that is the answer you are looking for. This means that the graphic is not in an anchored frame.

    Russ

  • Scroll the document to a specified graphics object window

    Hello

    someone knows a way to scroll through the document to a graphical object window specified?

    I tried with the F_ApiScrollToText() function, but it only works with the object that contains the text and text does not have a graphical object (like a line)...

    Thanks in advance.

    There is not directly command to control, but if you push the slider to the bottom of the graph, then a button will scroll and display on the window.

    The code example is below:

    IntT fcodes [] = {CSR_DOWN};

    Set the target graph

    F_ApiSetInt (docId, graphicId, FP_GraphicIsSelected, True);

    / * Slider down to go to this graph * /.
    F_ApiFcodes (sizeof (fcodes) /sizeof (IntT), fcodes);

    Just above the code, it works fine for me.

  • Graphic objects on a custom Manager

    Hello, all,.

    I've implemented a Manager with complex methods of sublayout() and object.  sublayout() uses layoutChild() and childPosition() to place fields (some of which are in turn the instances of the same custom handler class) on the screen.  object uses graphical methods (setBackgroundColor, clear, setColor, drawLine, drawBitmap, drawText) to emulate the net.rim.device.api.ui.decor functionality (that we support v4.2).  I use no clipping rectangle to optimize the behavior that the performance is decent enough as it is.

    My problem is that the small rectangular parts of the screen are sometimes deleted the background color.  Fixes extra "navigation" on the screen.  Hell, asking same background (at least) and return to the application solves the problem!

    Here are a few images to see how the same screen looks like at different times (it is a simulator with 5.0.0.442 9700, phones and other simulators of all look at them differently, but close).  The last of them is the way in which the screen is supposed to look like, others have these "spots".  There is no field focus outside the screen main itself - all "navigation" is treated by painting the fields differently.

    Any idea what's going on?  I confused framework BB enough to do some weird stuff?

    Found the problem!  In my calls of drawText that I used g.getClippingRect () .width to get the available width for the text, which is clearly wrong.  Once I changed it to the extent of the field under the position of the original text and less good padding / width of the right border, everything started working.

    Sorry to bother everyone with my own stupidity,

    Arkady.

  • Satellite A660-12E - freezes with graphical objects

    Hello

    Here's my problem:

    I bought a Satellite A660-12th. Was obtained last Saturday, transported with great caution.

    The problem is that when I use a program dependent CG as a game, the games freezes quickly, even in the menus, with the screen objects, symptom of failure of CG (that happened in the menus of TF2, alien swarm and all playing Plain SIght). When Windows (with aero and transparency), goes on the internet, watching movies, everything is ok. No problem when using 3DSmax and Mudbox, but does not check since the last time the problem happened.
    In addition, the problem does not occur the first time that I start a game. After a long series of the computer (I use a cooling station and check the temperature: never more than 55 ° c) to download a game on steam, for example.

    I tried to install my own version of windows 7 (64 bit professional), updated the cg driver, installed a selection of programs from ninite.com, but the problem is back.

    Since then, I am a student with low resources and worked all summer to get a laptop, I am a little upset. :/
    Anyone has a solution, or should I contact the customer as soon as possible?

    Thank you.

    Hello

    Can you explain what CG and CG pilot mean, please?

    I can only tell you that it is important to use the original display driver Toshiba place drivers nVidia because they are pre-tested and overheating protection. So be sure that Toshiba display the most recent driver is installed.

  • serializer custom replicated cache possible?

    Hi all

    I would like to know if it is possible to use a serializer custom on a replicated cache. I have it working successfully for a partitioned cache, but it doesn't seem to be a < serializer > tag to the duplicate version.

    Thank you
    Luke


    My excerpt from config.xml

    < distributed plan >
    partition of < scheme name > < / system-name >
    < service name > DistributedCache < / service-name >

    < serializer >
    > class name < com.tangosol.io.pof.ConfigurablePofContext < / class name >
    < init-params >
    < init-param >
    type string < param > < / param-type >
    < param-value of the property system = "pof - config.xml" > file:pof-config.xml < / param-value >
    < / init-param >
    < / init-params >
    < / serializer >

    < support-map-plan >
    schema < class >
    < system-Ref > by default-support-map < / plan-ref >
    < / class-system >
    < / support-map-plan >

    backup < number > 0 < / backup-County >
    < / distributed plan >

    < replicated system >
    default < scheme name > < / system-name >
    < service name > ReplicatedCache < / service-name >
    < support-map-plan >
    schema < class >
    < system-Ref > by default-support-map < / plan-ref >
    < / class-system >
    < / support-map-plan >
    < / replicated system >
    < / cache-plans >

    <!-card memory support, disable statistics - >
    schema < class >
    < scheme name > - by default-support-map < / system-name >
    > class name < com.tangosol.util.SafeHashMap < / class name >
    < / class-system >


    .. .the pof - config.xml extracted...

    Type < user >
    < type id > 105 < / id-type >
    > class name < AuditEvent < / class name >
    < serializer >
    > class name < AuditEventPOF < / class name >
    < / serializer >
    < / user type >


    .. .and what is at AuditEventPOF...

    / public class AuditEventPOF implements PofSerializer {}
    public void serialize (writer PofWriter, java.lang.Object o) {}
    public java.lang.Object deserialize (PofReader reader)
    }

    It is a known issue, which we do not have the document in the Coherence 3.4 Known Issues page. I just added to the page, and the fix will be a part of Patch 2, which will be published in a few days.

    Kind regards
    Gene

  • HP Pavilion dv7-7110 m Ent. : How can I change my laptop graphics card? is this possible?

    How can I change my graphics card. is this possible? I am waiting for your answer?

    Hello

    Unfortunately, your Nvidia gpu is integrated with the system board and is not an evolutionary element.

    Kind regards

    DP - K

  • Graphic object based on the paragraph Style style?

    I just checked the documentation of the API and saw nothing on the point about this.

    Is it possible to write a script that applies a Style object to a jpg image based on the paragraph Style applied to this image jpg online online?

    Hello

    I did the following:

    var curDoc = app.activeDocument;
    
    app.findGrepPreferences = app.changeGrepPreferences = null;
    app.findGrepPreferences.findWhat= "~a";
    var allFounds = curDoc.findGrep();
    
    for (var i = 0; i < allFounds.length; i++) {
      var curFound = allFounds[i];
      if (curFound.allGraphics.length > 0) {
        var pStyleName = curFound.paragraphs[0].appliedParagraphStyle.name;
        if (pStyleName == "paraStyle") {
          var rect = curFound.rectangles[0];
          rect.appliedObjectStyle = curDoc.objectStyles.itemByName("myStyle");
        }
      }
    }
    

    Kai

  • Graphic objects

    Just import video from my 3 ghost seems to have a few graphical artifacts. In the following example of split-screen, I also added some color correction as it makes it a little easier to see objects, but they are there on the imported raw video so. On the right side in the sky, you can see several concentric circles from the center of the image.

    Left side is raw video of phantom before importation, so after importation and the right color correction.

    PremiereELements.jpg

    I forgot to mention, it's the 12 Version of elements and the video is 1920 x 1080

    It's an interesting comparison, MRC.

    Why do you have output and MPEG, rather than a Premiere Elements MP4? MPEG is not as effectively compressed and are often intertwined. Or I read the specifications of your hurt.

    Apples to apples comparison would certainly compare with mp4s mp4s.

  • Task to the mapping of object status: is it possible to have user-defined status?

    Hi guru.

    'Task of object state Mapping' tab for the definition of the process allows you to set the "status of the object' to 'status '.

    'Status of the object' contains values defined on "Definition of the State" for defined object "resource". It is possible to extend this list by adding user-defined status. But the allocation of these statutes (for example, 'view data name updated') for status (say, 'C', finished) it causes a corresponding Bundle error is found.

    How is it possible to use the user defined the statutes?

    Hello

    These statutes are pre-defined and shipped by the IOM.

    You cannot change C-> etc. put into service.

    ~ J

Maybe you are looking for

  • How to stop the mp3 to open automatically in iTunes

    When I download an mp3 file as soon as it has finished downloading, a copy is made and it reads back in iTunes.  I don't want to do that, I need to find the newly added mp3 and delete iTunes.   I was not able to find a way to prevent this. When I dow

  • I can't delete a canceled download...

    ... (Ironically, it was a new version of firefox) in Firefox v4 Windows XP Professional. I have also already tried safe mode and have administrator privileges, it always says cannot delete because another program is using, even when no programs (incl

  • Laptop is not repairable, so I got a brand new

    With all due respect,. I have a dilemma on my upgrade from windows 7 Home premium.Well, I bought a laptop brand new in January 2010. His pre installed OS is Windows Vista Home Premium.I got the coupon for the upgrade to Windows 7 Home Premium, and I

  • TI Will GeForce GTX 750 FTW 2 GB PCI-E w / ACX cooling works on Μatx-H61-Joshua (Joshua)

    Hello. I want to buy GeForce GTX 750 Ti FTW 2GB PCI-E w / ACX cooling and I don't know if I can connect to my motherboard: Μatx-H61-Joshua (Joshua) and I think through my Powersupply 650Watts and I don't know if its power to put the power supply on t

  • Card reader doesn't read the card of 1 GB - Satellite M40X

    Hello I'm French, soory for my English. I have a Satellite M40X-141. I can't read maps 1 go like the xd or MMC with the drive - integrated card, this normal? Thank you