Author Topic: AMEP Project Properties?  (Read 1675 times)

0 Members and 1 Guest are viewing this topic.

MexicanCustard

  • Swamp Rat
  • Posts: 705
AMEP Project Properties?
« 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.
Revit 2019, AMEP 2019 64bit Win 10

Jeff H

  • Needs a day job
  • Posts: 6150
Re: AMEP Project Properties?
« Reply #1 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............
                        }
                    }
                }
            }           
                                 
        }

MexicanCustard

  • Swamp Rat
  • Posts: 705
Re: AMEP Project Properties?
« Reply #2 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.
Revit 2019, AMEP 2019 64bit Win 10

kdub_nz

  • Mesozoic keyThumper
  • SuperMod
  • Water Moccasin
  • Posts: 2140
  • class keyThumper<T>:ILazy<T>
Re: AMEP Project Properties?
« Reply #3 on: May 26, 2011, 06:48:50 PM »

Interesting that the pjtReg.LevelIds  are uint

 
Called Kerry in my other life
Retired; but they dragged me back in !

I live at UTC + 13.00

---
some people complain about loading the dishwasher.
Sometimes the question is more important than the answer.