Skip to content

Instantly share code, notes, and snippets.

@chuongmep
Created June 13, 2020 12:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chuongmep/217063d7c2ec2fe6a0c01880ee5e05af to your computer and use it in GitHub Desktop.
Save chuongmep/217063d7c2ec2fe6a0c01880ee5e05af to your computer and use it in GitHub Desktop.
public static string Convert3DTo2D(Revit.Elements.Views.View view, List<Element> GridorLevel)
{
Document doc = DocumentManager.Instance.CurrentDBDocument;
View v = view.InternalElement as View;
TransactionManager.Instance.EnsureInTransaction(doc);
List<DatumPlane> planes = GridorLevel.Select(x => x.InternalElement).Cast<DatumPlane>().ToList();
foreach (DatumPlane datumPlane in planes)
{
datumPlane.SetDatumExtentType(DatumEnds.End0, v, DatumExtentType.ViewSpecific);
datumPlane.SetDatumExtentType(DatumEnds.End1, v, DatumExtentType.ViewSpecific);
}
TransactionManager.Instance.TransactionTaskDone();
TransactionManager.Instance.ForceCloseTransaction();
return "Execute";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment