Multiple use for imported parts

Dylan_Stewart
Dylan_Stewart Member, Developers Posts: 107 PRO
Okay, I'm going to try and explain this to the best of my ability (<--Feel like I've said that before?? :/)

So I have a profile that I am importing in to a FS..... easy enough...
Then, I turn it in to a function. 

export enum sealantProfileID
{
    annotation { "Name" : "1/16 inch" }
    F72Dq47pUtYbudg_0,

    annotation { "Name" : "1/8 inch" }
    Fe9DDixnU9zeHn2_0,

    annotation { "Name" : "1/4 inch" }
    FCofrjEa8xpUaY3_0
}

export function evsealantProfileID(value is sealantProfileID)
{
    return {
                "F72Dq47pUtYbudg_0" : .0625 * inch,
                "Fe9DDixnU9zeHn2_0" : .125 * inch,
                "FCofrjEa8xpUaY3_0" : .25 * inch
            }[value as string];
}

So my question is can I use this to extrude the imported profile PS while using it as a function? 
I have tried and I'm not having any luck....

Really, I would like to reduce the amount of options in UI and I thought I might be able to get 2 birds with 1 stone here.
Digital Engineering

Comments

  • kevin_o_toole_1
    kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 565 image
    You can use that enum to indicate both a sketch id and an extrude thickness via that function, yes.

    Can you share a document to give us a better idea of what you're trying to do?
  • Dylan_Stewart
    Dylan_Stewart Member, Developers Posts: 107 PRO
    Thank you @kevin_o_toole_1

    I got it figured out. I was actually calling the wrong sketch in my FS..... 
    Digital Engineering