Message 1 of 15
View.IsolateElementTemporary not isolating Element
Not applicable
09-13-2016
02:05 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Im trying to create a ViewPlan and isolate a Element in it, but the following code does create the ViewPlan, it just doesn't isolate the Element. Any help would be appreciated.
public View ByBoundingBox(
BoundingBoxXYZ bb,
View viewTemplate,
ViewFamilyType viewFamilyType,
Level level,
string name,
float[] offset,
ElementId isolateElementId = null
)
{
XYZ minPt = new XYZ(bb.Min.X - offset[3], bb.Min.Y - offset[2], 0);
XYZ maxPt = new XYZ(bb.Max.X + offset[1], bb.Max.Y + offset[0], 0);
bb.Min = minPt;
bb.Max = maxPt;
ViewPlan vp = ViewPlan.Create(this.UIDocument.Document, viewFamilyType.Id, level.Id);
vp.Name = name;
vp.CropBox = bb;
vp.CropBoxActive = true;
vp.ViewTemplateId = viewTemplate.Id;
if (isolateElementId != null && isolateElementId != ElementId.InvalidElementId)
{
vp.EnableTemporaryViewPropertiesMode(vp.Id);
vp.IsolateElementTemporary(isolateElementId);
}
return vp;
}