Query by part name

ben_partouch
ben_partouch Member, csevp Posts: 168 PRO

Hi,

When importing a part studio via custom FS, can I call a specific part, by name, so I can then use it for an operation within that same FS?

Thanks,

Comments

  • EvanReese
    EvanReese Member, Mentor Posts: 3,099 PRO

    You could use attributes for this if you have access to set them on the source studio. https://cad.onshape.com/FsDoc/library.html#module-attributes.fs

    Evan Reese
    The Onsherpa | Reach peak Onshape productivity
    www.theonsherpa.com
  • ben_partouch
    ben_partouch Member, csevp Posts: 168 PRO

    Thank you @EvanReese

    But how do I set them? Should I create a FS in that source studio just to do that?

    Also, what about properties?

    🙏

  • EvanReese
    EvanReese Member, Mentor Posts: 3,099 PRO

    Yes, you'd make a feature to set them. You could use a Query Driven Array Parameter with a string field so you can name each part you pick and use setAttribute(). I believe part properties are regenerated after all of the features in your studio, which is why you can't access them with Custom Features, but can with Custom Tables (I'm not sure on derived parts that already have them, but I suspect you can't get them).

    Evan Reese
    The Onsherpa | Reach peak Onshape productivity
    www.theonsherpa.com
  • ben_partouch
    ben_partouch Member, csevp Posts: 168 PRO

    Ok I will try that. Thank you 🙏