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.

Two point generation for imported parts.

Lucas_LovettLucas_Lovett Member Posts: 6

I want to do a two point generation system for imported parts in a featurescript I'm making and I previously did it like this
if (definition.generationChoice == generationType.TWO)
{
opExtrude(context, id + "hexShaft", {
"entities" : qSketchRegion(id + "sketchOne", true),
"direction" : dir,
"endBound" : BoundingType.BLIND,
"endDepth" : norm(endVec - startVec),
"operationType" : NewBodyOperationType.NEW
});
with dir being
dir = normalize(endVec - startVec);
but I want to use an imported part to do a similar thing.
How I currently add my part is like this
const eightyTwenty1x1 = addInstance(instantiator, eightyTwenty1x1::build, { "configuration" : { "z" : definition.length }, "transform" : thingTransform });
the thingTransform is here
var thingTransform is Transform = toWorld(evMateConnector(context, { "mateConnector" : definition.startPoint }));
I was wondering if maybe I could make it start on a plane I can switch where it is directed similar to my original way and just have the plane face the way it needs to go and have it extrude out to that distance needed or if there was a different way I needed to do it. Any advice or documentation would be greatly appreciated.

Sign In or Register to comment.