TheSwamp

Code Red => .NET => Topic started by: MexicanCustard on May 26, 2011, 01:53:34 PM

Title: AMEP Project Properties?
Post by: MexicanCustard on May 26, 2011, 01:53:34 PM
Does anybody know how to get the Project Properties, via .NET, set up in AMEP's Project Manager? What I'm trying to get is the floor levels so I can tell if a pipe is drawn above or below the current floor.
Title: Re: AMEP Project Properties?
Post by: Jeff H on May 26, 2011, 03:18:31 PM
See if you can add anymore for each loops in this

Code: [Select]
        [CommandMethod("ProjectLevels")]
        public void ProjectLevels()
        {
            Document doc = Application.DocumentManager.MdiActiveDocument;
            Database db = doc.Database;
            Editor ed = doc.Editor;

            ProjectBaseManager pjtBaseMgr = ProjectBaseServices.Service.ProjectManager;
            ProjectFileName pjtFileName = pjtBaseMgr.CurrentProjectFileName;
            Project pjt = pjtBaseMgr.OpenProject(OpenMode.ForRead, pjtFileName.Path);

            ProjectConfiguration pjtConfig = pjt.Configuration;

            ProjectFile pjtFile = pjt.GetFile(db);

            foreach (ProjectRegion pjtReg in pjtFile.Regions)
            {
                uint[] levelids = pjtReg.LevelIds;
                foreach (uint levelid in levelids)
                {
                    foreach (ProjectLevel pjtLvl in pjtConfig.Levels)
                    {
                        if (pjtLvl.Id == levelid)
                        {
                            //pjtLvl.CutPlaneHeight;
                            //pjtLvl.Description;
                            //pjtLvl.Elevation;
                            //pjtLvl.Height;
                            //pjtLvl.Name;
                            //etc............
                        }
                    }
                }
            }           
                                 
        }
Title: Re: AMEP Project Properties?
Post by: MexicanCustard on May 26, 2011, 04:05:19 PM
See if you can add anymore for each loops in this
LOL, will do.

Thanks! Exactly what I was looking for.
Title: Re: AMEP Project Properties?
Post by: kdub_nz on May 26, 2011, 06:48:50 PM

Interesting that the pjtReg.LevelIds  are uint