ADNExplodeGeometry.ADN_Utility.AddOsmShell C# (CSharp) Method

AddOsmShell() public static method

Adds the Shell modifier to the provided node (by handle).
public static AddOsmShell ( uint nodeHandle, float shellAmount ) : int
nodeHandle uint Input the node handle to add the modifier to.
shellAmount float Input the amount of shell thickness as float.
return int
        public static int AddOsmShell(uint nodeHandle, float shellAmount)
        {
            try
            {

                IGlobal global = Autodesk.Max.GlobalInterface.Instance;
                IInterface14 ip = global.COREInterface14;

                IClass_ID cidOsmShell = global.Class_ID.Create(0x3b9b1a16, 0x6d84e8d0);
                AddOsmModifier(nodeHandle, cidOsmShell);

                IINode node = ip.GetINodeByHandle(nodeHandle);
                IModifier mod = GetModifier(node, cidOsmShell);
                if (mod != null)
                {
                    IIParamBlock2 pb = mod.GetParamBlock(0);
                    pb.SetValue(0, 0, shellAmount, 0); // innerAmount parameter is at index zero of the parameter block.
                }
            }
            catch (Exception ex)
            {
                Debug.Print(ex.Message);
                return -1;
            }

            return 1;
        }