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.

array of queries back to a single query?

johnsoggjohnsogg Member, Developers Posts: 14
I have an array of queries using this:

var edges is array = evaluateQuery(context, edgesQuery);

The `edges` array is then post-processed a bit, which leaves me with an array-of-arrays. I need to use each nested array as input to `constructPath`, but this requires a single query for its input, rather than an array of queries.

Is there a way I can create a new single query out of my array of queries?

Also, unrelated but a question I am dying to find out: is there a way to print the type of an object?

Comments

  • johnsoggjohnsogg Member, Developers Posts: 14
    Answering my own question. `var edges = qUnion(lotsOfIndividualQueriesArray)` does the trick.
  • ilya_baranilya_baran Onshape Employees, Developers, HDM Posts: 932
    Correct regarding qUnion.  You can get the object type by printing it out bypassing the toString methods.  The output of println("" ~ object) will have that information (try it for a few things whose type you know).
    Ilya Baran \ Director, Architecture and FeatureScript \ Onshape Inc
Sign In or Register to comment.