-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exculde template view during View3d wrapping #1239
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -152,14 +152,14 @@ public static WallType Wrap(Autodesk.Revit.DB.WallType ele, bool isRevitOwned) | |
|
||
public static View3D Wrap(Autodesk.Revit.DB.View3D view, bool isRevitOwned) | ||
{ | ||
if (view.IsPerspective) | ||
if (!view.IsTemplate) | ||
{ | ||
return PerspectiveView.FromExisting(view, isRevitOwned); | ||
} | ||
else | ||
{ | ||
return AxonometricView.FromExisting(view, isRevitOwned); | ||
if (view.IsPerspective) | ||
return PerspectiveView.FromExisting(view, isRevitOwned); | ||
else | ||
return AxonometricView.FromExisting(view, isRevitOwned); | ||
} | ||
return null; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am hesitate to wrap template 3dViews to whatever since that wrapping seems to always success that we might wrapped them to wrong dynamo types without the right query from IsPerspective(). I am returning null, as a result, they will appear "null" in the list of watch node. let me know if this is a bad idea. |
||
} | ||
|
||
public static Element Wrap(Autodesk.Revit.DB.ViewPlan view, bool isRevitOwned) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -425,8 +425,8 @@ public void DynamoAllSelectionNodeTests_WithPreSelectedEntities() | |
ViewModel.OpenCommand.Execute(testPath); | ||
|
||
// check all the nodes and connectors are loaded | ||
Assert.AreEqual(35, model.CurrentWorkspace.Nodes.Count()); | ||
Assert.AreEqual(18, model.CurrentWorkspace.Connectors.Count()); | ||
Assert.AreEqual(38, model.CurrentWorkspace.Nodes.Count()); | ||
Assert.AreEqual(20, model.CurrentWorkspace.Connectors.Count()); | ||
|
||
AssertNoDummyNodes(); | ||
|
||
|
@@ -446,7 +446,7 @@ public void DynamoAllSelectionNodeTests_WithPreSelectedEntities() | |
var floor = GetPreviewValueAtIndex(allElementAtLevelNodeID, 2) as Revit.Elements.Floor; | ||
Assert.IsNotNull(floor); | ||
|
||
// ElementsOfCategory & Categories, as output of Categories | ||
// ElementsOfCategories & Adaptive Points, as output of Categories | ||
// passed to ElementsOFCategory | ||
var elementsOfCategoryNodeID = "24f225e1-8883-48c3-a8ba-773b2734336c"; | ||
AssertPreviewCount(elementsOfCategoryNodeID, 22); | ||
|
@@ -456,6 +456,11 @@ public void DynamoAllSelectionNodeTests_WithPreSelectedEntities() | |
Assert.IsNotNull(refPt); | ||
} | ||
|
||
// ElementsOfCategories & Views, as output of Categories | ||
// passed to ElementsOFCategory | ||
var elementsOfViewNodeID = "2569434a-b34f-4512-a4fe-f065c7a10175"; | ||
AssertPreviewCount(elementsOfViewNodeID, 33); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add a new case filtering out all views in the sample.rvt, since template views will appear null, by pass the null check. |
||
|
||
// ElementsOfFamilyType & Family Type, as FamilyType output passed to | ||
// ElementsOfFamilyTypes node. | ||
var elementsOfFamilyTypeNodeID = "657017f1-4775-4daa-b00e-8d85392be6b5"; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exclude template views for now, waiting for API guild's response whether we should totally ignore them or there are other work around.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is OK to ignore them. I think our users only cares about normal views (that may have a view template applied).