camahiahua
Automotive
- Nov 16, 2010
- 4
Hi everyone,
I have a CATProduct and I need to select all the Bodies which have a material applied. I know there are some queries by the search command in order to filter the searchs, but I dont know how to achieve my goal with this query.
What I was doing first, was to select all the Bodies within the Product with the next command
Selection.Search "'Part Design'.Body;all"
And then I am checking each Body at a time to know if there is any material applied.
Set Body = Selection.Item(k).Value
TheMaterialManager.GetMaterialOnBody Body, TheMaterial
Density =TheMaterial.AnalysisMaterial.GetValue("SAMDensity")
if there is no material applied i will get an error by reading the density so with this Err.Number<>0 I know there is no material.
I know my solution is not very elegant, so I am trying to find another method with a query or something
Do you guys know any other way to do this with a query or other method?
Thanks in Advance
I have a CATProduct and I need to select all the Bodies which have a material applied. I know there are some queries by the search command in order to filter the searchs, but I dont know how to achieve my goal with this query.
What I was doing first, was to select all the Bodies within the Product with the next command
Selection.Search "'Part Design'.Body;all"
And then I am checking each Body at a time to know if there is any material applied.
Set Body = Selection.Item(k).Value
TheMaterialManager.GetMaterialOnBody Body, TheMaterial
Density =TheMaterial.AnalysisMaterial.GetValue("SAMDensity")
if there is no material applied i will get an error by reading the density so with this Err.Number<>0 I know there is no material.
I know my solution is not very elegant, so I am trying to find another method with a query or something
Do you guys know any other way to do this with a query or other method?
Thanks in Advance