3 Replies Latest reply on Aug 1, 2016 9:08 AM by Clément Girard

    No API for Insert, Feature, Imported... ??

    Ron Bates

      - I have a parasolid file on disk.

      - I have another SW file open.

      - Insert, Feature, Imported... and select my parasolid file, to create a new feature based on the imported body.

       

      It doesn't record.  And I haven't found anything obvious in api help on how to do this...create an imported body that is.  There's an example of replacing an existing imported body using SetBody2.  But it assumes you already have an imported body.  I can't use LoadFile as that will create a new document.  So it would seem I have to create some kind of dummy imported body (using something like IBody2::CreateBodyFromSurfaces), and then use SetBody2 to "replace" it with my file on disk...??  I'm not even sure that will work.

       

      Am I missing something?  Is there an easier way to create a new feature in an existing document, from a file on disk?

       

      I guess another alternative, which is even more terrible, is to load the parasolid file, save the new document, then use InserPart2 to put it into my original document.  But then I have an external reference to the original part file that I don't want...