How can I use profiles that are not user defined in the loft feature?

darren_13
darren_13 Member, Developers Posts: 120 PRO
I created two profiles in my feature script and now I want these to be used in the loft feature, is there a way of using them? like profile is from sketch 1 at point (x,y)? or maybe someone could just direct me to a script that demos this if its easier?

Kind regards,
Darren Lynch

Best Answer

Answers

  • NeilCooke
    NeilCooke Moderator, Onshape Employees Posts: 6,123 image
    edited September 2016
    Create a separate sketch for each profile, making sure you solve each sketch first, then add them to an array and pass them to opLoft. 
    Senior Director, Technical Services, EMEA
  • darren_13
    darren_13 Member, Developers Posts: 120 PRO
    edited September 2016
    Excellent, would it be possible to exclude a profile from the loft? one profile loft and extrude another on the same set of sketches or is it better doing two separate sketches?
  • darren_13
    darren_13 Member, Developers Posts: 120 PRO
    var SketchStore=[sketch1,sketch2];


    opLoft(context, id + "loft1", {
                    "profileSubqueries" : SketchStore
            });


    I get, expect map found sketch? I have solved sketches 1 and 2 am I inputting the array correctly or does it need to be in a certain format?

    Cheers, Darren
  • zak_nienstedt
    zak_nienstedt Member Posts: 1 ✭
    NeilCooke said:
    The input needs to be a query so use qCreatedBy(id + "sketch1") and sketch2 in your array
    Old thread but since I was just working on something similar I thought I'd leave a comment...

    At least in my implementation, the above approach didn't quite work.  I needed to add an entity type:

    var SketchStore = [qCreatedBy(id + "sketch1", EntityType.FACE), qCreatedBy(id + "sketch2", EntityType.FACE)];