2 Replies Latest reply on Jan 2, 2014 1:31 PM by Noam Yogev

    How to create a special attribute to solidworks item, and than find and select it by that  attribute?

    Noam Yogev

      Hello All,

       

      Im looking for a way to "mark" with a special attribute or property (editable) a feature / component/ device in solidworks, in order to find it again with api call.

       

      let me describe the scenario:

      1. im using a 3rd party application to manage db of a mechanical project.

      2. im developing an addin to solidworks, that wii integrate this 3rd party app with solidworks.

      3. every item in my app has a unique ID string, that i want to attach to a solidworks item, in order to cross-probe those 2 items in bothe environments.

      4. I'd like to get my unique ID string and use it to navigate and select the item in solidworks tree and in the graphcal area.

      5. until now, the only way to select an object in solidworks that i know of is by using :

       

           swModel.Extension.SelectByID2(objName, "BODYFEATURE", 0, 0, 0, false, 0, null, 0)

       

      problem is, that the linkage between sldx to "my app" item, cannot be based on name, furthermore, not all solidworks entitys enable changing name.

       

      please advise me, on how to implement this better.

       

      Thanks

      Noam