How to extrude imported parts with a featurescript

Lucas_Lovett
Lucas_Lovett Member Posts: 6 ✭

I am making a featurescript that generates some parts to make the CAD process faster for my FRC team and I'm not sure how to extrude an imported part. I want to make it so that you can change it's length based off a definition.length inputted earlier in the featurescript. This is my first time doing a featurescript so the answer might be obvious but I just don't know what to do yet. If someone could point me to the right documentation or give me some examples that'd be greatly appreciated.
Code Snippet I have for the import of the 8020 part I want to extrude
if (definition.materialSelection == materialChoice.eightyTwenty)

    {
        startVec = evVertexPoint(context, { "vertex" : definition.startPoint });
        if (definition.generationChoice == generationType.TWO)
        {
            endVec = evVertexPoint(context, { "vertex" : definition.endPoint });
            dir = normalize(endVec - startVec);
            dVec = endVec - startVec;
            normDVec = norm(dVec);
        }
        if (definition.generationChoice == generationType.ONE)
        {
            csys = evMateConnector(context, { "mateConnector" : definition.startPoint });
            dir = csys.zAxis;
            if (definition.reverseDir == true)
            {
                dir = -1 * csys.zAxis;
            }
        }
        if (definition.generationChoice == generationType.ONE)
        {
            if (definition.eightyTwentyType == eightyTwentyTypeOptions.ONE)
            {
                addInstance(instantiator, eightyTwenty1x1::build, { "transform" : thingTransform });
                instantiate(context, instantiator);
            }
            if (definition.eightyTwentyType == eightyTwentyTypeOptions.TWO)
            {
                addInstance(instantiator, eightyTwenty1x2::build, { "transform" : thingTransform });
                instantiate(context, instantiator);
            }
        }
        if (definition.generationChoice == generationType.TWO)
        {
        }
    }

Any tips on how to layout this differently would be greatly appreciated as well since this is one of my first featurescripts so any advice or tips would be greatly appreciated.

Comments