Create multiple objects using a loop for

Help, please

I am newer to AI Scripting.

I need to create 30 arrow as objects (d0, d1,..., d29) with different lengths.  I can store lengths in an array (' mylength [] ' ")- but I have to copy the same code and more than 30 times?  Can I create an object where the name of the object is a member of another table?  If I could I could run a loop for to create all 30 arrows.

This is the code I have-

var d0 = peoplelayer.pathItems.add (); privacy of D0= true;

D0.setEntirePath ([[0,0], [-16, 12] [-16, 8] [-mylength [0], 8],[-mylength[0],-8],[-16,-8],[-16,-12]]);

This code has the idea, but it doesn't work - not

var arrownames = ["d0", "d1", "d2",..., "d29"]

var arrownames [0] = peoplelayer.pathItems.add (); private of arrownames [0]= true;

arrownames [0].setEntirePath ([[0,0], [-16, 12] [-16, 8] [-mylength [0], 8],[-mylength[0],-8],[-16,-8],[-16,-12]]);

Something that could have?

Hi theBGF.

var mylength = [5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100,105,110,115,120,125,130,135, 140,145,150,155];
var d = new Array();

for (i = 0; i<>
    d [i] = app.activeDocument.layers [0].pathItems.add ();
    d [i].setEntirePath ([[0,0], [-16, 12] [-16, 8] [-mylength [i], 8],[-mylength[i],-8],[-16,-8],[-16,-12]]);
private d [i]= true;
}

Try this script.
You can access arrow object (pathItems) are d [1] d [30].

Tags: Illustrator

Similar Questions

  • Create several screws using a loop for

    Hello

    I am still fairly new to LabVIEW, that this issue might be easy for you guys here...

    I'm going to simplify what I'm doing.

    I have two digital controllers who act as the rows and columns of a matrix.

    I would take those figures of these two controllers and use them to create a matrix of a certain image.

    Example:

    The controller of lines is 3, and columns controller has 4.

    Using these numbers, I would like that the final result to show a certain image (say, a cube) on a matrix of 3 times 4.

    Let's say that the image is an X, then the end result should be:

    XXXX

    XXXX

    XXXX

    I think I should use a double loop for (one inside the other, obviously), and I should also create the 'position' property to display each image of the cube to its rightful place.

    The problem is that I don't know how to CREATE the images over and over again, while being able to control the position of each property.

    Any help would be GREATLY appreciated!

    These small 'boxes' (key word being little) are simply called under screws.  Express vIs are large blue abominations that take valuable real estate and are intended to make life easier for you.

    This is the VI recorded in LV8.6

  • Create a table in a loop 'for' (reset the number of loops)

    Hello

    I try to incorporate a signal of acceleration from an analog input CRIO to get speed and then further integrate to get the moving of a vibration system.

    I understand that to achieve integration, a table must be fed in. My problem is that I could not buffer the signal in a buffer block, as I couldn't find buffer blocks. so I decided to create my data table by using a loop "for". The nests of the loop 'for' inside a timed loop. The problem that I'm stuck on is how to reset the loop 'for' in order to fill the buffer with each iteration of the outer loop timed.

    I enclose the code if that helps. Note that I use labview in 2013.

    If anyone who has encountered a similar problem before can help me, I would be gratefull.

    Concerning

    Ali

    You can use a shift register initialized as inputs to your curls, to build your table of one. However, you realize, don't you, that the execution of your program as written loops as soon as the computer can spit out responses, then the output array may contain several points that took place before the entry has updated? Assuming that your thing cRIO (I've not worked with these) has integrated into its routine acquisition of calendar data, I suggest you put that inside the loop to get a data point by reading.

    And do you really want your graph to distance for update only every thousand points (points of acceleration million) speed?

    Cameron

  • Control reference 1055 error when you use a loop for

    Hello

    I'm having a problem using control references to accomplish the following: I a VI that reads data from a text file, and then uses that automatically update the value of a control on front panel on two live different, then set the default values, and then save them. Comes from the array of control references, I tried looping on text labels until I have find the one corresponding to the order, I want to change and then update its value. The problem I have is that if I use a loop for, then 9times of LabVIEW 10 complains error 1055: "LabVIEW: object reference is not valid. If instead I the wiring to the index table and manually extract the reference, then it works every time and for each index of the reference of the order.

    Can someone take a look at my code and just see if its obvious what the problem is? In this case, I have a simple solution, but I would really like to understand what I did wrong. I have included as a code snippet, but also attached the files if that helps (Its Import_Colormap.vi, which is the problem). Persons with disabilities code fails, the active code works but I can't see what is really the difference between them - I can change the index of array 0,1,2, 3. and no mistake.

    Thank you.

    Your "Colormap.ctl" is a strict type def that contains a ring.  You define the elements programmatically, make the default values, and then save the "Colormap.ctl"?   I was never practicing this but here is a thread that covers this in detail. I do not understand what you expect reach by running.
    The next thing: at the same time (at the same time!), you open the Colormap.vi (this is what we see in yout PNG) that contains an instance of the Colormap.ctl on the front panel. I'm not pretty sure if LabVIEW can handle this correctly. This could be the reason why you sometimes get the error 1105.
    I prefer StringsAndValues and eventually the value of the ring running.  There is no need to do it with a def of strict type.

  • creation of an area of dynamic text inside a movieclip using a loop for

    I'm having issues creating several areas of dynamic text inside a movieclip using a loop for.  I use 2 ACEs.  Here is the code I've created so far

    var leading: Number = 0;

    function drawClip (): Void

    {

    this.createEmptyMovieClip ("mc", 10);

    for (i = 0; i < 5; i ++)

    {

    mc.createTextField ('text areas' + i, this.getNextHighestDepth (), 0, leading, 200, 200)

    MC ["text boxes" + i] .text = i;

    leader + a = 20;

    }

    }

    drawClip();

    Create a mc but she only display the number 5

    Any thoughts?

    You are cionstantly, crushing the textfield created previously due to the use of the wrong depth define.  You point to 'this' to get a depth value, but he planted inside 'mc', so it's always at the same depth since "this" index of depth does not change.  Use...

    mc.createTextField ('text areas' + i, mc.getNextHighestDepth (), 0, leading, 200, 200)

  • HOW TO CREATE A STOP COMMAND IN LOOP FOR

    I have a problem. I can't put a stop to the VI attached here. I want to stop an iteration without support on cancel execution, because I want to connect this VI by a Subvi to control a motor continuous.

    Thank you

    Hello

    in order to stop your first vi, you can use a stop button for the while loop to 'or' with the release of your "equal" comparison function Then you can also use a local variable created the stop button to stop the loop for, configure it with a conditional expression (right click on the loop for > conditional expression).

    This way if you press "stop"button, you will stop the while loop and the loop together foor.

    Good bye

  • make a graph in real time of 1 DBL value at a time, using a loop for

    I have a somewhat interesting programming task where I have the following situation: (I have attached a mac version of vi Labview 2013)

    -Using a patented (pre-made and uneditable) sub - vi, who receives a value of 0 or 1 as input and reads off a single measure, whenever he receives 1 while a value of 0 is necessary to 'reset' of the vi to rehearse a new measure.

    -I would like to run this sub - vi repeatedly in a loop For each value of "measure" are sent to a curve of waveform to give a direct value (real time) for the graphic to display.

    -As it is, I have a vi file that simulates action in a loop but built in a 1 d array to get exuent values sent a waveform curve.

    -I don't know how to make a real-time graph which receives 1 value double both.

    -In addition, I want only every 2nd value sent to the loop for, but I already have several ideas on how to do it.  First of all, I am concerned about the target in real time.

    Kyle Shiel

    A graphic, not a graphic, allows you to update a point at a time. It would be inside the loop for. update the chart or not, you can use a select statement or the structure of the case.

    These are pretty basic functions in LabVIEW. Please see the free tutorials.

  • You can trigger through communication Modbus TCP/IP PLC data acquisition without using a loop for?

    Hello

    I am trying to contact a facility through a Modbus TCP/IP communication PLC. I'm new to this method, but the idea is that the installation will send the logical (Boolean) values 1 bit by ethernet to my workstation which read and then will begin data acquisition. Basically, I need a triger to come to my pc. I placed my vi inside a structure case T/F which will run according to the signal, it receives data acquisition. However, for it constantly waiting, I put this in a loop for. The works of vi, but playback signals sometimes lagging behind due to the loop for. If I take the loop out and just run labview permanently, it works perfectly, but I know that the option is only for debugging and should not be used. So my question is, is there a better way to wait for an incoming signal?

    Hello!

    Please note that the order of execution of the write operations on the shared variable 000002 is not determined.

    For example, nothing prevents this order of execution:

    (1) value false 000002

    (2) set to true 000002

    (3) execution of the loop

    In what concerns the delay, you might consider placing a waiting vi in the case of 'false', or the loop uses 100% of CPU if I'm not mistaken...

    Kind regards

    Marco

  • Iterate over all others (or number) of element in an array using a loop for

    I'm going through a table, but instead of autoindexing I want to ignore all the other elements or perhaps a number of elements that will be specified for the user.

    The basic features I want to reach are the next in C code.

    int temp_var = 10;

    int i = 0;

    for (i = 0; i<=1000; i="">

    {

    }

    I am very new to LabVIEW and I didn't know how to use internal variables.

    Can this be achieved using the registers at offset?

    I enclose the code that I currently have to do this. Let me know what you think.

    Thank you guys.

    You must implement this one a While loop with a shift register to hold the index.  The index must be changed by the step size.  Here is the code:

    I asked for a new style of loop For which would specify start, stop and the conditions of the stage, but it seems that a lot of people is just not this idea.  Don't know why?

    See here.

  • Is it possible to create an object using Trapcode Form and then use that object as a particle in Trapcode particular?

    I made a few objects in Cinema 4 d and I tried to import them into after effects CC 2014.  I get an error saying "Cannot find Adobe Premiere Pro Dynamic Link".  So I tried in AE CC and that worked.  However, I would like to create a form object and then use it as a particle Trapcode particular.  Is it still possible?

    Thanks for any help!

    You can use almost anything in any publication as a particular particle. However, the particles will be actually 3 dimensions. You can simulate a 3d look by the presence of an object revolving in a precomp and loop as the animation of the particle, but not otherwise.

  • Excerpt from my table using the loop For

    Hello

    I have this loop to create a 2D array. The result is on the table below. I want that this 2D table should be fully completed and compiled, then it will be sent out of the loop.

    I don't want to extract the value of table 2D is a loop. This is the problem that I am facing.

    My ultimate goal is to extract the individual number of the final table of the 2D table line and be an entry for other functions.

    Please help me. Thank you

    PX

    Hi PX.

    Here's a solution without using screw express

  • How to set horizontal scrolling to horizontal field Manager when fields are added using a loop for?

    The following code snippet contains a horizontal field Manager to which are added five buttons.

    1. I can't the value of horizontal scrolling to horizontal management Manager because of who I am not able to access the keys 4 and 5.

    2. usually, we put horizontal scrolling in the following way:

    container = new HorizontalFieldManager(USE_ALL_WIDTH|HORIZONTAL_SCROLL|HORIZONTAL_SCROLLBAR);
    

    3. so I also tried setting of horizontal scrolling in the following way

       container = new HorizontalFieldManager(Manager.HORIZONTAL_SCROLL|Manager.HORIZONTAL_SCROLLBAR)
                {
    
                    protected void sublayout(int maxWidth, int maxHeight) {
    
                        Field field = null;
                        int x = 0;
                        int y = 0;
                        int maxFieldHeight = 0;
                        int maxFieldWidth = 0;
                        for (int i = 0; i < getFieldCount(); i++)
                        {
                            field = getField(i);
                            layoutChild(field, maxWidth, maxHeight);
                            setPositionChild(field, x/*width-field.getWidth()*/,y);
    
                            x+=field.getWidth();
    
                            maxFieldWidth = maxFieldWidth + field.getWidth();
                            System.out.println("field width"+field.getWidth());
                            System.out.println(" max field width"+maxFieldWidth);
    
                            if(i==0)
                            {
                                maxFieldHeight = field.getHeight(); // height set of the first button since all components have the same height
                            }
                        }
                        System.out.println("final max field width"+maxFieldWidth);
    
                        setExtent(maxFieldWidth, maxFieldHeight);
    
                    }
                };
    

    but it's not working.

    4 I found this property: (position) horizontalFieldManager.setHorizontalScroll; that contains the parameterioo where the post is supposed to be the new horizontal scroll position. I tried passing the coordinate x of horizontal field Manager, but it does not work. I should pass as a parameter position?

    HorizontalFieldManager container = new HorizontalFieldManager()
    {
        protected void sublayout(int maxWidth, int maxHeight)
        {
            Field field = null;
            int x = 0;
            int y = 0;
            int maxFieldHeight = 0;
            for (int i = 0; i < getFieldCount(); i++)
            {
                field = getField(i);
                layoutChild(field, maxWidth, maxHeight);
                setPositionChild(field, x,y);
                x+=field.getWidth();
                if(i==0)
                {
                    maxFieldHeight = field.getHeight(); // height set of the first button since all components have the same height
                }
            }
    
            setExtent(Display.getWidth(), maxFieldHeight);
    
        }
    };
    
    ButtonField button1 = new ButtonField("Button1");
    ButtonField button2 = new ButtonField("Button2");
    ButtonField button3 = new ButtonField("Button3");
    ButtonField button4 = new ButtonField("Button4");
    ButtonField button5 = new ButtonField("Button5");
    
    container.add(button1);
    container.add(button2);
    container.add(button3);
    container.add(button4);
    container.add(button5);
    
    add(container);
    

    Need your valuable comments and suggestions. Please help me.

    I think that there is a bug in the sublayout (your HorizontalFieldManager 0 mode.  Given that the code did what I think WHAT HFM will do anyway, I recommend that you try to do this with a standard HFM, using this style:

    Manager.HORIZONTAL_SCROLL | Manager.HORIZONTAL_SCROLLBAR

    Let us know how you go.

    When I have more time I'll explain the bug, but if you want to investigate something, be aware that the maximum size that you can use in setExtent are the values that are passed to sublayout.  Compare the width as you try to define in setExtent whose width is increased.

  • How to create multiple page using LiveCycle PDF forms?

    I am trying to create a PDF on several pages from LiveCycle. I selected Hirarchy in the Windows menu and choose to create a new Master Page. So now I have two forms created (one below the other) I can't convert them to PDF format. Whenever I convert it to PDF only page 1 is converted and the other is not. It's as if the conversion function completely ignores the fact that there is page 2 the form created. Can someone shed light on a possible solution please?

    Master page is as a background for the display pages. Several pages can have only one Master Page as a background or a container.

    You can add more pages to your form by a right click on the node root in the hierarchy pane, and then 'new Page '.

  • [Q] multiple deletion using movieclips &amp; quot; for &amp; quot;

    Hi, its simple task, but I couldn't do the things...

    Basically, I'm going to erase a 7 movieclips both in function...

    I tried with eval (..), this [...], but still does not work

    Can we please ~ ~ ~ save me from this misery ~!

    function F_list_remove() {}
    for (var j = 0; j)< 7;="" j++)="">
    removeMovieClip (mc_listholder ["listitem" + j]);
    }
    }

  • Application created using the BB for Eclipse plugin does not run in the Simulator

    Hi all!

    I created an application using BB plugin for Eclipse.  I try to run in the Simulator, but it never gets displayed (the application icon is never shown).  However, I create a "Hello World" sample, which works perfectly in the Simulator.  My application in Eclipse has never shows all files .cod or .jad, there only have files .jdp and .rapc

    My doesn´t app have encoding problems or errors of any kind (at least not displayed in the view of error).

    TIP: I have copy - paste code in different applications, is that a problem?

    I tried:

    • Restart Eclipse,
    • Configuration of active building of blackberry,
    • Cleaning of the project,
    • Creation of the project,
    • Reinstall Eclipse,

    but none of this seems to work.

    Can someone help me please?

    Best regards

    Juan.

    Hi all!

    In the event that a person gets the same problem, I mentioned.  I found the solution: it turns out that I had a very high class with a lot of code on it and that s the reason why the application does not get launched into the Simulator.  What I did that I shared this class on the 4different classes each managing different parts of the code and now it works perfectly.

    Hope someone is enjoying this, cause I spent a lot of time trying to figure out what the problem was.

    Best regards

    Juan.

Maybe you are looking for

  • Satellite L500-1XD - why the screen jump when running on batteries?

    I recently bought my L500 and it works very well when it is connected to the electric network, but when I running on battery the screen jumps and flickers.I was told to look at the BIOS but that seems fine. Any ideas? Thank youKate

  • After the update of the Bios. EFI error

    Hello! My ACER model: E5 - 572G 7 59. When I updated the Bios v. 1.03 - 1.06, then the update succeeded. But! I had two operating systems on the disk: Ubuntu gnome 14.04.2 & windows 8.1. The machine started with grub. After updating the Bios the mach

  • What does REt?

    I'm looking in the settings of the printer for my Laserjet 1022 and there is a checkbox for "RET" and I don't know what it does. Anone can advise?

  • CD-ROM/DVD-ROM drive

    Readers of CD-ROM/DVD-ROM disappeared from my computer...

  • BlackBerry Smartphones BlackBerry Curve does not illuminate

    I've never had problems with my BlackBerry... no load delivers, no power issues but yesterday I turned off my curve to remove the SIM card to check my daughter Pearl.  When I replaced my SIM card in my curve and I replaced the battery that has nothin