Exemplo n.º 1
0
        private void CreateCylindricalBody(IPartDoc part, CylinderParams cylParams)
        {
            IBody2 cylTempBody = swApp.IGetModeler().CreateBodyFromCyl(new double[]
            {
                cylParams.Origin[0], cylParams.Origin[1], cylParams.Origin[2],
                cylParams.Direction[0], cylParams.Direction[1], cylParams.Direction[2],
                cylParams.Radius, cylParams.Height
            }) as IBody2;

            IFeature feat = part.CreateFeatureFromBody3(cylTempBody, false,
                                                        (int)swCreateFeatureBodyOpts_e.swCreateFeatureBodySimplify) as IFeature;

            IBody2 body = feat.GetBody() as IBody2;

            body.MaterialPropertyValues2 = new double[] { 1, 1, 0, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5 };
        }