AnsweredAssumed Answered

Get bodies under structural member feature without user selection by api

Question asked by Aleksandras Korolkovas on Sep 16, 2019
Latest reply on Sep 18, 2019 by Aleksandras Korolkovas



how with api get access to the bodies (as object of 2017 SOLIDWORKS API Help - IBody2 Interface ) under structural member feature (picture below), but without:

a) selection by user 

b)  2017 SOLIDWORKS API Help - SelectByID2 Method (IModelDocExtension) 

c) other ways where need user interaction or know names for selection


I know possibility to find feature from body by traversing body features, but some SolidWorks features ( like combine bodies) hides other features.


Also there is possibility to get those bodies by getting feature faces, and from faces get bodies (IFeatures::GetFaces, IFeatures::IGetFaces2IFace2::GetBody, and IFace2::IGetBody). Here i see another issue. Body have many faces, so, i will get same body many times. I will use this option (just more code to filter which bodies are the same in list), but maybe someone knows other way?


P.S. I am using VB.NET