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.

Constructing a Part in a Part Studio using DXFs

ParkwoodParkwood Member Posts: 4 PRO
Hello All,

I am trying to build a configurator inside featurescript that will build an aluminium door (from our product line).
Some parts, such as the top bars and skins of the door can be created from standard geometry such as the cuboid command, and a host of other commands such as extrude etc.
However, other parts are made from aluminium extrusions, for which the sketch geometry is too complicated to draw within the featurescript, and the best way is to bring in a DXF file, which we have already sitting in OnShape. 
Assuming inputs are door height, width, clearance, and a whole range of relevant variables, is it possible to import a DXF from an enum - i.e. have an 'if' statement or array so that if a certain model of door is selected the DXF is assigned to a sketch. For example, when a residential flush door will have different profiles to a commercial, the relevant profiles is imported and extruded once the option has been selected. 

For example, a statement such as:

export enum DoorType
    {
        Residential,
        Commerical
    }

if (DoorType == Residential)
    {
        var LockStile = Profile_123,
        var HingeStile = Profile_345
    }

then obviously Profile_123 needs to be assigned and drawn within sketch "LockStile", and then extruded to "DoorHeight - DoorClearance"

Unfortunately I cannot share any documents or screenshots as the nature of the profiles and construction is very sensitive. I could share the raw code, but this will not be very useful without the profiles. 

I have searched around content for the past two days, and cannot really find anything useful on the forums. 

Thanks for your time. 

Comments

  • caden_armstrongcaden_armstrong Member, User Group Leader Posts: 33 PRO
    One option would be to use configurations.
    If all of the dxf sketches were in a single part studio, you could create a configuration table, with each row corresponding to a specific sketch (and thus all other sketches are suppressed for that configuration).
    Then you could use the instantiator functionality to import the correct sketches only needing to specify the configuration.


    Another note, you can also use the configuration table rows as an enum in the featurescript form.
    Software Development Lead - CADSharp
Sign In or Register to comment.