AnsweredAssumed Answered

Get Body in drawing view with Flat Pattern sheet metal

Question asked by Bruno Frade on May 11, 2019
Latest reply on May 13, 2019 by Nilesh Patel

Hello, 

i have a multi-body part, with sheet metal, in drawing crated a view and selected just one body from part,

problem arrives when i select flat pattern... before, i could get the body  thru "View.Bodies"  but as soon as i set flat pattern, view.Bodies always return null... how can i get that body? goal is to get the material assigned to it(wich i can achieve when not in flat configuration)...

 

arrBody = view.Bodies;
Body2 body = (Body2)arrBody[0];
string materialName = body.GetMaterialIdName2();
if(!string.IsNullOrEmpty(materialName))
{
   string[] mat2 = materialName.Split('|');
   if(mat2.Count() == 3)
   {
      string mat = mat2[1]);
      return;
   }
}

Outcomes