TheSwamp
Code Red => .NET => Topic started 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.
-
See if you can add anymore for each loops in this
[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............
}
}
}
}
}
-
See if you can add anymore for each loops in this
LOL, will do.
Thanks! Exactly what I was looking for.
-
Interesting that the pjtReg.LevelIds are uint