How to make beam feature drive part numbers?

Eleanor_Coffin
Eleanor_Coffin Member Posts: 43 ✭✭✭
I've been using the beam feature regularly and would really like the ability to have it set the component's part number as well as name. (To the exact same thing -- nothing fancy.) I know I can do it with a mix of variables and a Part Number FS, but I'm regularly working with 8+ beams per part studio, all of whose lengths are driven by a combination of config variables/config lists, and it's a really lengthy process.

I'm really not familiar with feature scripts so am looking for some guidance on how to do this. Thanks!

Best Answer

  • Alex_Kempen
    Alex_Kempen Member Posts: 260 EDU
    Answer ✓
    The easiest solution is probably to make a personal copy of the Beam FeatureScript, figure out wherever it's setting the part name (control + f setProperty, look for PropertyType.NAME), and add a duplicate setProperty call right after, this time with the property type set to PropertyType.PART_NUMBER.

    It's actually quite difficult to do it after the beams have been created since reading off part names (and other part properties) with FeatureScript requires some finagling, and most methods to do so don't update automatically, meaning if you change the name, you'll have to manually update the feature. That's why simply making a modified version of the Beam FS is probably the most straightforward solution. 
    Software Developer at Epic Systems
    FRC Design Mentor - Team 10553 Orange Overdrive


Answers

  • Alex_Kempen
    Alex_Kempen Member Posts: 260 EDU
    Answer ✓
    The easiest solution is probably to make a personal copy of the Beam FeatureScript, figure out wherever it's setting the part name (control + f setProperty, look for PropertyType.NAME), and add a duplicate setProperty call right after, this time with the property type set to PropertyType.PART_NUMBER.

    It's actually quite difficult to do it after the beams have been created since reading off part names (and other part properties) with FeatureScript requires some finagling, and most methods to do so don't update automatically, meaning if you change the name, you'll have to manually update the feature. That's why simply making a modified version of the Beam FS is probably the most straightforward solution. 
    Software Developer at Epic Systems
    FRC Design Mentor - Team 10553 Orange Overdrive


  • Eleanor_Coffin
    Eleanor_Coffin Member Posts: 43 ✭✭✭
    Editing that FeatureScript worked like a charm! I appreciate the specific instructions on what lines to change, thank you @Alex_Kempen