Settings

Choose language

type (text,point,angle,textsize)

type
  • Creates a new object that contains text, written next to the given point at the given angle of the given size.

    Function parameters


  • text in “” quotations or name of a string variable
  • name of the point
  • (optional) angle, 0 by default
  • (optional) text size, 1 cm by default

    Usage


    If the name of a text variable is not set in code, the default name is formed as T_point. You can use mathematical equations, variables, object properties, size constants in syntax, e.g.

    newtext=type(“Here goes text”,P1,[P1:P2].a1,3) // see example above

    It is important to remember that this function will type exactly the symbols that you have placed in the quotations. Sometimes you wish to place numeric information on a pattern piece, for example length of the zipper required.
    You have probably calculated it in the code, for example

    ziplength=round(side.l*0.9,1) // length of zipper equals 90% of the length of object named side, and the result is rounded to point, one decimal

    Depending on the size measurements, this number will be different, e.g. it may be 13.7 for S size, and 15.1 for XXL size. We would like this information to be printed on the pattern. If we code

    ziptext = type(“Minimal zipper length is ziplength cm”,P1),

    the software will not understand that we are referring to a numerical variable here. The result will be as on the right.

    This is not exactly what we want, so let us take the variable out of the quotation marks, and append it to the string parts of the text with + signs, as below. You will also see that string parts and numerical values now have different colors in code editor window.

    ziptext = type(“Minimal zipper length is”+ ziplength + “ cm”,P1),

    The software will append the first part of text to the variable and to the last part of text, and print the result. When your pattern is graded, this text will be updated automatically.
  • Previous article

    mark (point,angle,type,length,width)

    Next article

    dash (object1,object2,...,objectx)