Quering relevant sketch vertices

konstantin_shiriazdanov
konstantin_shiriazdanov Member Posts: 1,221 ✭✭✭✭✭
edited July 2017 in FeatureScript
I have an original sketch, with some dimentions refferencing to variable. My feature takes this sketch as FeatureList and i apply identityTransform to this sketch in a loop varying value of the variable, so i'm obtaining a family of sketch bodies, among which I need to select only the sequence of the vertices, which are obtained from the selected vertex of the original sketch. So the question is how to get queries of sketch entities, that are derived from user-defined sketch using FeatureList, without knowing internal sketch id's of the entity in original sketch (or how to get internal sketch id of the entity from user defined sketch)

Comments

  • kevin_o_toole_1
    kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 565 image
    Because a feature pattern is genuine code reexecution of the original feature, there are no real correspondences built between one instance of the pattern and the next. As you've said, the sketch ids, in practice, will match between runs, but as you said, that's only useful if you had the original id.

    In your case, I think the workflow of creating a single point body in the sketch (as you've done already) is the best workaround available. To make that interface clear, I imagine your feature could reportFeatureInfo(... "Selected sketch must have a single sketch point defined") if you get zero or 2+ points in the sketch.

  • konstantin_shiriazdanov
    konstantin_shiriazdanov Member Posts: 1,221 ✭✭✭✭✭
    ok, thank you @kevin_o_toole_1. one more question, i'm going to use optionally local coordinate system (defined by MC) and that MC can be related to the mooving parts of my sketch so from the one side a had to treat it as FeatureList, but from another side i need to calculate coordinates relatively to that MC so I need it to be of Query type. can I for example define input field for MC as Query, and then make a copy of that MC query as FeatureList?
  • kevin_o_toole_1
    kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 565 image
    Unless I'm misunderstanding, I would say just take the mate connector as a query. If you create the curve in the position of the current sketch, you can transform the final result to the given mate connector as the last step. No need to involve the feature list for that.