Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. Be respectful, on topic and if you see a problem, Flag it.

If you would like to contact our Community Manager personally, feel free to send a private message or an email.

Options

Having troubles with: skCircle(Sketch, Id (array), map) does not match skCircle(..., string, ...)

darren_13darren_13 Member, Developers Posts: 118 PRO
the id: id+'circle1'+keys

debugs to: Id : [ "FIZxwPCJn00T9Nq_1" , "circle1" , "0" ]

I presume the issue is that it is an array of strings however this is valid for a sketch so I am puzzled. The link is: 
https://cad.onshape.com/documents/95877be3b17f49277e87a2c3/w/b503830fd20472014beb1221/e/4c4431103f44e823aca947dd

the feature script is 'Wing Structure Parametric' in folder 'Wing Structure Creator (prac)'

Thanks in advance,
Darren

Comments

  • Options
    kevin_o_toole_1kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 565
    FeatureScript has two kinds of ids. Operation ids (including the id passed into newSketchOnPlane) are the Id type, which is a hierarchical array of strings. But inside of sketches, ids are just plain strings. skCircle is expecting a string, and you're giving it an array with the Id type.

    In FS, the ~ operator joins values as strings, so you'll probably want to use something like id ~ 'circle1' ~ keys
  • Options
    darren_13darren_13 Member, Developers Posts: 118 PRO
    Thanks again @kevin_o_toole_1
  • Options
    lanalana Onshape Employees Posts: 703
    Just to expand a little on Kevin's comment.  Operation ids have to be of the shape id + ... ( where id is the id argument of custom feature), they have to be unique within the context( == within part studio), while sketch entity id in skXXX functions are strings and need to be unique within the sketch.
    e.g. It is valid to do something like:
    var sketch = newSketchOnPlane(context, id + "sketch1,..)
    for (var i = 0; i < 5; i += 1)
    {
        skCircle(sketch, "circle_" ~ i, ..);
    }
    skSolve(sketch);

    sketch = 
    newSketchOnPlane(context, id + "sketch2,..);
    skCircle(sketch, "circle_1", '..)
    skSolve(sketch);
  • Options
    darren_13darren_13 Member, Developers Posts: 118 PRO
    Ah, cheer's @lana that makes my job easier. Cheers for the follow-up :) 
Sign In or Register to comment.