示例#1
0
        } //end GetPartSize()

        private string GetPartCndtType(Member mem)
        {
            DataRecord dr           = PartManager.GetPartData(mem);
            DataField  df           = dr.FindByContextAndIndex(Context.CatalogPartSizeName, 0);
            string     partCndtType = df.ValueString;

            if (partCndtType.Contains("GRC"))
            {
                partCndtType = "GRC";
            }
            if (partCndtType.Contains("EMT"))
            {
                partCndtType = "EMT";
            }
            Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;

            ed.WriteMessage("\nCONDUIT TYPE: " + partCndtType);

            return(partCndtType);
        }//end GetPartCndtType()
示例#2
0
        } //end GetAECObjects()

        private double GetPartSize(Member mem)
        {
            DataRecord dr           = PartManager.GetPartData(mem);                             //Pulls the partdata from the object as a datarecord.
            DataField  df           = dr.FindByContextAndIndex(Context.CatalogPartSizeName, 0); //Searches through the MEP catalog for size name.
            string     partSizeName = df.ValueString;                                           //Sets the name to a string value.

            Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;

            //write out partsizename to command line for debugging.
            ed.WriteMessage(partSizeName.ToString());

            //Removes the trailing text, just leaving the number. (FOR CONDUIT ONLY)
            partSizeName = partSizeName.Remove(5);

            //Converts the string to a number for later math.
            Double psn = Convert.ToDouble(partSizeName);

            /*Now do something with the partsize
             *
             * 1.00 in EMT SS -> 1.0
             * 0.50 in EMT SS -> 0.5
             */
            return(psn);
        } //end GetPartSize()