diff --git a/src/-TUM.CMS.VPLControl b/src/-TUM.CMS.VPLControl new file mode 160000 index 0000000..52113a9 --- /dev/null +++ b/src/-TUM.CMS.VPLControl @@ -0,0 +1 @@ +Subproject commit 52113a91269c6e75837d36dadf76bdb9d11fcda8 diff --git a/src/2017/ENGyn-Nodes/ENGyn-Nodes-2017.csproj b/src/2017/ENGyn-Nodes/ENGyn-Nodes-2017.csproj index 2389af9..97e0d71 100644 --- a/src/2017/ENGyn-Nodes/ENGyn-Nodes-2017.csproj +++ b/src/2017/ENGyn-Nodes/ENGyn-Nodes-2017.csproj @@ -37,6 +37,9 @@ MinimumRecommendedRules.ruleset false + + bin\Release\ + ..\..\packages\Navisworks-2017-x64-API.1.0.0\lib\net46\AdWindows.dll @@ -193,6 +196,9 @@ GetClashInfo.cs + + Math\Math.cs + Navisworks\CloseNavisworks.cs diff --git a/src/2017/ENGyn/ENGyn-2017.csproj b/src/2017/ENGyn/ENGyn-2017.csproj index 6e8e3b2..9547a1f 100644 --- a/src/2017/ENGyn/ENGyn-2017.csproj +++ b/src/2017/ENGyn/ENGyn-2017.csproj @@ -33,69 +33,53 @@ ..\..\packages\Navisworks-2017-x64-API.1.0.0\lib\net46\AdWindows.dll - False ..\..\packages\Navisworks-2017-x64-API.1.0.0\lib\net46\Autodesk.Navisworks.Api.dll - False ..\..\packages\Navisworks-2017-x64-API.1.0.0\lib\net46\Autodesk.Navisworks.Automation.dll - False ..\..\packages\Navisworks-2017-x64-API.1.0.0\lib\net46\Autodesk.Navisworks.Clash.dll - False ..\..\packages\Navisworks-2017-x64-API.1.0.0\lib\net46\Autodesk.Navisworks.ComApi.dll - False ..\..\packages\Navisworks-2017-x64-API.1.0.0\lib\net46\Autodesk.Navisworks.Controls.dll - False ..\..\packages\Navisworks-2017-x64-API.1.0.0\lib\net46\Autodesk.Navisworks.Interop.ComApi.dll - False - False + True ..\..\packages\Navisworks-2017-x64-API.1.0.0\lib\net46\Autodesk.Navisworks.Interop.Timeliner.dll - False - False + True ..\..\packages\Navisworks-2017-x64-API.1.0.0\lib\net46\Autodesk.Navisworks.Resolver.dll - False ..\..\packages\Navisworks-2017-x64-API.1.0.0\lib\net46\Autodesk.Navisworks.Takeoff.dll - False ..\..\packages\Navisworks-2017-x64-API.1.0.0\lib\net46\Autodesk.Navisworks.Timeliner.dll - False ..\..\packages\Navisworks-2017-x64-API.1.0.0\lib\net46\navisworks.gui.common.dll - False ..\..\packages\Navisworks-2017-x64-API.1.0.0\lib\net46\navisworks.gui.generic.dll - False ..\..\packages\Navisworks-2017-x64-API.1.0.0\lib\net46\navisworks.gui.interface.dll - False ..\..\packages\Navisworks-2017-x64-API.1.0.0\lib\net46\navisworks.gui.roamer.dll - False ..\..\packages\Navisworks-2017-x64-API.1.0.0\lib\net46\navisworks.roamer.plugin.dll - False ..\packages\Newtonsoft.Json.Net20.dll.3.5.0\lib\2.0\Newtonsoft.Json.Net20.dll diff --git a/src/2018/ENGyn-Nodes/ENGyn-Nodes-2018.csproj b/src/2018/ENGyn-Nodes/ENGyn-Nodes-2018.csproj index 1a31c21..5154563 100644 --- a/src/2018/ENGyn-Nodes/ENGyn-Nodes-2018.csproj +++ b/src/2018/ENGyn-Nodes/ENGyn-Nodes-2018.csproj @@ -37,6 +37,9 @@ MinimumRecommendedRules.ruleset false + + bin\Release\ + ..\..\packages\Navisworks-2018-2019-x64-API.1.0.1\lib\net46\AdWindows.dll @@ -193,6 +196,9 @@ GetClashInfo.cs + + Math\Math.cs + Navisworks\SaveNWFile.cs diff --git a/src/2019/ENGyn-Nodes/ENGyn-Nodes-2019.csproj b/src/2019/ENGyn-Nodes/ENGyn-Nodes-2019.csproj index 31992f4..2a8828c 100644 --- a/src/2019/ENGyn-Nodes/ENGyn-Nodes-2019.csproj +++ b/src/2019/ENGyn-Nodes/ENGyn-Nodes-2019.csproj @@ -37,6 +37,9 @@ MinimumRecommendedRules.ruleset false + + bin\Release\ + ..\..\packages\Navisworks-2018-2019-x64-API.1.0.1\lib\net47\AdWindows.dll @@ -191,6 +194,9 @@ GetClashInfo.cs + + Math\Math.cs + Navisworks\SaveNWFile.cs diff --git a/src/ENGyn-Nodes/Comments/GetViewpointsComments.cs b/src/ENGyn-Nodes/Comments/GetViewpointsComments.cs index dc5de2f..5a26d27 100644 --- a/src/ENGyn-Nodes/Comments/GetViewpointsComments.cs +++ b/src/ENGyn-Nodes/Comments/GetViewpointsComments.cs @@ -1,13 +1,6 @@ -using System.Windows.Controls; -using System.Xml; -using Autodesk.Navisworks.Api; -using TUM.CMS.VplControl.Nodes; -using Autodesk.Navisworks.Api.Clash; -using TUM.CMS.VplControl.Core; -using System.Windows.Data; -using System.Windows; +using Autodesk.Navisworks.Api; using System.Collections.Generic; -using System; +using TUM.CMS.VplControl.Core; namespace ENGyn.Nodes.Comments { @@ -22,7 +15,7 @@ public GetComment(VplControl hostCanvas) //Help this.BottomComment.Text = "Gets Comments list associated with SavedItem: e.g. Clash or Viewpoint "; this.ShowHelpOnMouseOver = true; - + } @@ -31,7 +24,7 @@ public override void Calculate() { var viewpoint = InputPorts[0].Data; - + OutputPorts[0].Data = MainTools.RunFunction(getViewpointsComments, InputPorts); } @@ -39,7 +32,7 @@ public object getViewpointsComments(object viewpoint) { var output = new List(); if (viewpoint is Viewpoint || - viewpoint is SavedItem || + viewpoint is SavedItem || viewpoint is SavedViewpoint) { var v = viewpoint as SavedItem; diff --git a/src/ENGyn-Nodes/ENGyn-Nodes.csproj b/src/ENGyn-Nodes/ENGyn-Nodes.csproj index 587b4de..a54193a 100644 --- a/src/ENGyn-Nodes/ENGyn-Nodes.csproj +++ b/src/ENGyn-Nodes/ENGyn-Nodes.csproj @@ -37,77 +37,64 @@ MinimumRecommendedRules.ruleset false + + bin\Release\ + - - ..\packages\Navisworks-2017-x64-API.1.0.0\lib\net46\AdWindows.dll - False + + ..\packages\Navisworks-2018-2019-x64-API.1.0.1\lib\net46\AdWindows.dll - - ..\packages\Navisworks-2017-x64-API.1.0.0\lib\net46\Autodesk.Navisworks.Api.dll - False + + ..\packages\Navisworks-2018-2019-x64-API.1.0.1\lib\net46\Autodesk.Navisworks.Api.dll - - ..\packages\Navisworks-2017-x64-API.1.0.0\lib\net46\Autodesk.Navisworks.Automation.dll - False + + ..\packages\Navisworks-2018-2019-x64-API.1.0.1\lib\net46\Autodesk.Navisworks.Automation.dll - - ..\packages\Navisworks-2017-x64-API.1.0.0\lib\net46\Autodesk.Navisworks.Clash.dll - False + + ..\packages\Navisworks-2018-2019-x64-API.1.0.1\lib\net46\Autodesk.Navisworks.Clash.dll - - ..\packages\Navisworks-2017-x64-API.1.0.0\lib\net46\Autodesk.Navisworks.ComApi.dll - False + + ..\packages\Navisworks-2018-2019-x64-API.1.0.1\lib\net46\Autodesk.Navisworks.ComApi.dll - - ..\packages\Navisworks-2017-x64-API.1.0.0\lib\net46\Autodesk.Navisworks.Controls.dll - False + + ..\packages\Navisworks-2018-2019-x64-API.1.0.1\lib\net46\Autodesk.Navisworks.Controls.dll - - ..\packages\Navisworks-2017-x64-API.1.0.0\lib\net46\Autodesk.Navisworks.Interop.ComApi.dll - False - False + + ..\packages\Navisworks-2018-2019-x64-API.1.0.1\lib\net46\Autodesk.Navisworks.Interop.ComApi.dll + True - - ..\packages\Navisworks-2017-x64-API.1.0.0\lib\net46\Autodesk.Navisworks.Interop.Timeliner.dll - False - False + + ..\packages\Navisworks-2018-2019-x64-API.1.0.1\lib\net46\Autodesk.Navisworks.Interop.Timeliner.dll + True - - ..\packages\Navisworks-2017-x64-API.1.0.0\lib\net46\Autodesk.Navisworks.Resolver.dll - False + + ..\packages\Navisworks-2018-2019-x64-API.1.0.1\lib\net46\Autodesk.Navisworks.Resolver.dll - - ..\packages\Navisworks-2017-x64-API.1.0.0\lib\net46\Autodesk.Navisworks.Takeoff.dll - False + + ..\packages\Navisworks-2018-2019-x64-API.1.0.1\lib\net46\Autodesk.Navisworks.Takeoff.dll - ..\packages\Navisworks-2017-x64-API.1.0.0\lib\net46\Autodesk.Navisworks.Timeliner.dll - False + ..\packages\Navisworks-2018-2019-x64-API.1.0.1\lib\net46\Autodesk.Navisworks.Timeliner.dll ..\packages\Microsoft.Office.Interop.Excel.15.0.4795.1000\lib\net20\Microsoft.Office.Interop.Excel.dll True - - ..\packages\Navisworks-2017-x64-API.1.0.0\lib\net46\navisworks.gui.common.dll - False + + ..\packages\Navisworks-2018-2019-x64-API.1.0.1\lib\net46\navisworks.gui.common.dll - - ..\packages\Navisworks-2017-x64-API.1.0.0\lib\net46\navisworks.gui.generic.dll - False + + ..\packages\Navisworks-2018-2019-x64-API.1.0.1\lib\net46\navisworks.gui.generic.dll - - ..\packages\Navisworks-2017-x64-API.1.0.0\lib\net46\navisworks.gui.interface.dll - False + + ..\packages\Navisworks-2018-2019-x64-API.1.0.1\lib\net46\navisworks.gui.interface.dll - - ..\packages\Navisworks-2017-x64-API.1.0.0\lib\net46\navisworks.gui.roamer.dll - False + + ..\packages\Navisworks-2018-2019-x64-API.1.0.1\lib\net46\navisworks.gui.roamer.dll - - ..\packages\Navisworks-2017-x64-API.1.0.0\lib\net46\navisworks.roamer.plugin.dll - False + + ..\packages\Navisworks-2018-2019-x64-API.1.0.1\lib\net46\navisworks.roamer.plugin.dll ..\packages\ncalc.1.3.8\lib\NCalc.dll @@ -189,6 +176,7 @@ + diff --git a/src/ENGyn-Nodes/Input/CSV.cs b/src/ENGyn-Nodes/Input/CSV.cs index 0007cb8..24942de 100644 --- a/src/ENGyn-Nodes/Input/CSV.cs +++ b/src/ENGyn-Nodes/Input/CSV.cs @@ -1,12 +1,11 @@ using System.Windows.Controls; -using Autodesk.Navisworks.Api; -using Autodesk.Navisworks.Api.Clash; using TUM.CMS.VplControl.Core; using System.Windows; using System.Collections.Generic; using System.IO; using System.Text; +using Autodesk.Navisworks.Api.Clash; namespace ENGyn.Nodes.Input { diff --git a/src/ENGyn-Nodes/Input/SaveFile.cs b/src/ENGyn-Nodes/Input/SaveFile.cs index 89e28a7..bbc4431 100644 --- a/src/ENGyn-Nodes/Input/SaveFile.cs +++ b/src/ENGyn-Nodes/Input/SaveFile.cs @@ -1,14 +1,6 @@ -using System.Windows.Controls; -using System.Xml; -using Autodesk.Navisworks.Api; -using TUM.CMS.VplControl.Nodes; -using Autodesk.Navisworks.Api.Clash; -using TUM.CMS.VplControl.Core; -using System.Windows.Data; -using System.Windows; -using System.Collections.Generic; -using System.Windows.Input; +using System.Windows; using System.Windows.Forms; +using TUM.CMS.VplControl.Core; namespace ENGyn.Nodes.Input { @@ -34,7 +26,7 @@ public override void Calculate() { OutputPorts[0].Data = filePath; - + } string filePath; diff --git a/src/ENGyn-Nodes/List/FilterMask.cs b/src/ENGyn-Nodes/List/FilterMask.cs index 07b6a36..7228051 100644 --- a/src/ENGyn-Nodes/List/FilterMask.cs +++ b/src/ENGyn-Nodes/List/FilterMask.cs @@ -1,15 +1,8 @@ -using System.Windows.Controls; -using System.Xml; -using Autodesk.Navisworks.Api; -using TUM.CMS.VplControl.Nodes; -using Autodesk.Navisworks.Api.Clash; -using TUM.CMS.VplControl.Core; -using System.Windows.Data; -using System.Windows; -using System.Collections.Generic; -using System; +using System; using System.Collections; +using System.Collections.Generic; using System.Linq; +using TUM.CMS.VplControl.Core; namespace ENGyn.Nodes.List { @@ -37,12 +30,12 @@ public override void Calculate() var mask = InputPorts[1].Data; if (input != null && mask != null) { - if( MainTools.IsList(input) && MainTools.IsList(mask)) + if (MainTools.IsList(input) && MainTools.IsList(mask)) { - - var filtered= FilterByBoolMask(input as IList, mask as IList); + + var filtered = FilterByBoolMask(input as IList, mask as IList); OutputPorts[0].Data = ((IEnumerable)filtered["in"]).Cast().ToList(); - + OutputPorts[1].Data = ((IEnumerable)filtered["out"]).Cast().ToList(); } @@ -53,7 +46,7 @@ public override void Calculate() } - + public override Node Clone() { diff --git a/src/ENGyn-Nodes/List/GetItemAtIndex.cs b/src/ENGyn-Nodes/List/GetItemAtIndex.cs index a236e3a..06b2655 100644 --- a/src/ENGyn-Nodes/List/GetItemAtIndex.cs +++ b/src/ENGyn-Nodes/List/GetItemAtIndex.cs @@ -1,16 +1,8 @@ -using System.Windows.Controls; -using System.Xml; -using Autodesk.Navisworks.Api; -using TUM.CMS.VplControl.Nodes; -using Autodesk.Navisworks.Api.Clash; -using TUM.CMS.VplControl.Core; -using System.Windows.Data; - -using System.Collections.Generic; -using System; +using System; using System.Collections; +using System.Collections.Generic; using System.Linq; -using System.Windows; +using TUM.CMS.VplControl.Core; namespace ENGyn.Nodes.List { @@ -37,11 +29,11 @@ public override void Calculate() { //TODO : Catch this one var count = Int32.Parse(InputPorts[1].Data.ToString()); - - object inputs = InputPorts[0].Data ; - - object[] res = ((IEnumerable)inputs).Cast() - + + object inputs = InputPorts[0].Data; + + object[] res = ((IEnumerable)inputs).Cast() + .ToArray(); if (res != null && res.Length >= count + 1) @@ -50,11 +42,11 @@ public override void Calculate() } } - + } - + public override Node Clone() { return new GetItemAtIndex(HostCanvas) diff --git a/src/ENGyn-Nodes/List/ListFlatten.cs b/src/ENGyn-Nodes/List/ListFlatten.cs index 86b2f1a..d122ca1 100644 --- a/src/ENGyn-Nodes/List/ListFlatten.cs +++ b/src/ENGyn-Nodes/List/ListFlatten.cs @@ -1,13 +1,5 @@ -using System.Windows.Controls; -using System.Xml; -using Autodesk.Navisworks.Api; -using TUM.CMS.VplControl.Nodes; -using Autodesk.Navisworks.Api.Clash; +using System.Collections.Generic; using TUM.CMS.VplControl.Core; -using System.Windows.Data; -using System.Windows; -using System.Collections.Generic; -using System; namespace ENGyn.Nodes.List { @@ -70,10 +62,10 @@ private static List Flatten(object list, int amt, List acc) if (amt == 0) { if (MainTools.IsList(list)) - { + { foreach (object item in (System.Collections.IEnumerable)list) - { - acc.Add(item); + { + acc.Add(item); } } else @@ -86,12 +78,12 @@ private static List Flatten(object list, int amt, List acc) foreach (object item in (System.Collections.IEnumerable)list) { if (MainTools.IsList(item)) - { + { var type = item.GetType(); acc = Flatten(item, amt - 1, acc); } else - { + { acc.Add(item); } } diff --git a/src/ENGyn-Nodes/List/ListTranspose.cs b/src/ENGyn-Nodes/List/ListTranspose.cs index 70a1b77..e34e18b 100644 --- a/src/ENGyn-Nodes/List/ListTranspose.cs +++ b/src/ENGyn-Nodes/List/ListTranspose.cs @@ -1,14 +1,7 @@ -using System.Windows.Controls; -using System.Xml; -using Autodesk.Navisworks.Api; -using TUM.CMS.VplControl.Nodes; -using Autodesk.Navisworks.Api.Clash; -using TUM.CMS.VplControl.Core; -using System.Windows.Data; -using System.Windows; +using System.Collections; using System.Collections.Generic; -using System.Collections; using System.Linq; +using TUM.CMS.VplControl.Core; namespace ENGyn.Nodes.List { @@ -32,17 +25,17 @@ public override void Calculate() if (input != null) { if (MainTools.IsList(input)) - { - var output = Transpose((System.Collections.IList)input); - OutputPorts[0].Data= output; + { + var output = Transpose((System.Collections.IList)input); + OutputPorts[0].Data = output; } - + } } - + public static System.Collections.IList Transpose(IList lists) { if (lists.Count == 0 || !lists.Cast().Any(x => x is IList)) diff --git a/src/ENGyn-Nodes/Math/Math.cs b/src/ENGyn-Nodes/Math/Math.cs new file mode 100644 index 0000000..d1b2697 --- /dev/null +++ b/src/ENGyn-Nodes/Math/Math.cs @@ -0,0 +1,218 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Windows.Controls; +using System.Windows.Input; +using System.Xml; +using NCalc; +using TUM.CMS.VplControl.Core; +using TUM.CMS.VplControl.Utilities; + + +namespace Nodes.Math +{ + public class ExpressionNode2 : Node + { + private Expression expression; + + public ExpressionNode2(VplControl hostCanvas) + : base(hostCanvas) + { + AddOutputPortToNode("Result", typeof(object)); + + var textBox = new TextBox { MinWidth = 120, MaxWidth = 300, IsHitTestVisible = false }; + textBox.TextChanged += textBox_TextChanged; + textBox.KeyUp += textBox_KeyUp; + + AddControlToNode(textBox); + + MouseEnter += ExpressionNode_MouseEnter; + MouseLeave += ExpressionNode_MouseLeave; + } + + private void textBox_KeyUp(object sender, KeyEventArgs e) + { + e.Handled = true; + } + + private void ExpressionNode_MouseLeave(object sender, MouseEventArgs e) + { + Border.Focusable = true; + Border.Focus(); + Border.Focusable = false; + } + + private void ExpressionNode_MouseEnter(object sender, MouseEventArgs e) + { + ControlElements[0].Focus(); + } + + private void textBox_TextChanged(object sender, TextChangedEventArgs e) + { + var textBox = sender as TextBox; + + if (textBox != null) + { + if (textBox.Text != "") + { + expression = new Expression(textBox.Text); + + var paras = GetParametersInExpression(textBox.Text).Distinct().ToList(); + + if (paras.Any()) + { + RemoveAllInputPortsFromNode(paras); + + var filteredParas = paras.Where(parameter => InputPorts.All(p => p.Name != parameter)).ToList(); + + foreach (var parameter in filteredParas) + AddInputPortToNode(parameter, typeof(object)); + } + } + else + { + expression = null; + RemoveAllInputPortsFromNode(); + } + } + + //Calculate(); + } + + public List GetParametersInExpression(string formula) + { + try + { + var expr = Expression.Compile(formula, false); + + var visitor = new ParameterExtractionVisitor(); + expr.Accept(visitor); + + return visitor.Parameters; + } + catch (Exception ex) + { + return new List(); + } + } + + private static List StrechArgumentLists(List ports, List> values) + { + List result = new List(); + //Fill values list + foreach (var arg in ports) + { + + System.Collections.IList argList = null; + if (ENGyn.Nodes.MainTools.IsList(arg.Data)) + { + argList = (System.Collections.IList)arg.Data; + } + //Check if argument is a list and include it on a Tuple with its count number + var argResult = argList != null ? new Tuple(argList.Count, argList) : new Tuple(1, arg.Data); + //if args are list, count the number of object to set how many times it should run + values.Add(argResult); + + } + //Get highest value == longest list count + int Highest = values.OrderBy(x => x.Item1).Reverse().ElementAt(0).Item1; + + + + for (int i = 0; i < Highest; i++) + { + var ActualArgList = new List(); + foreach (var item in values) + { + object currentArg = null; + if (item.Item1 > 1 || ENGyn.Nodes.MainTools.IsList(item.Item2)) + { + var tempArgList = (List)item.Item2; + //get latest object + + var currentArgListLenght = tempArgList.Count - 1; + currentArg = currentArgListLenght <= i ? tempArgList[currentArgListLenght] : tempArgList[i]; + ActualArgList.Add(currentArg); + } + else + { + currentArg = item.Item2; + ActualArgList.Add(currentArg); + } + } + List iterator =new List (); + + for (int ii = 0; ii < ports.Count; ii++) + { + var t = new Tuple(ports[ii].Name, ActualArgList[ii]); + iterator.Add(t); + } + + result.Add(iterator); + } + return result; + } + + public override void Calculate() + { + if (expression != null) + { + List> values = new List> (); + var result = StrechArgumentLists(InputPorts, values); + var output = new List(); + foreach (List port in result) + { + foreach (var item in (List)port) + { + var t = item as Tuple; + expression.Parameters[t.Item1] = t.Item2; + } + + try + { + output.Add(expression.Evaluate()); + } + catch (Exception ex) + { + output.Add(null); + } + } + + OutputPorts[0].Data = output; + } + else + OutputPorts[0].Data = null; + } + + public override void SerializeNetwork(XmlWriter xmlWriter) + { + base.SerializeNetwork(xmlWriter); + + var textBox = ControlElements[0] as TextBox; + if (textBox == null) return; + + xmlWriter.WriteStartAttribute("Formula"); + xmlWriter.WriteValue(textBox.Text); + xmlWriter.WriteEndAttribute(); + } + + public override void DeserializeNetwork(XmlReader xmlReader) + { + base.DeserializeNetwork(xmlReader); + + var textBox = ControlElements[0] as TextBox; + if (textBox == null) return; + + textBox.Text = xmlReader.GetAttribute("Formula"); + } + + public override Node Clone() + { + return new ExpressionNode2(HostCanvas) + { + Top = Top, + Left = Left + }; + } + } +} \ No newline at end of file diff --git a/src/ENGyn-Nodes/Navisworks/GetDocument.cs b/src/ENGyn-Nodes/Navisworks/GetDocument.cs index 029e15e..19c28b0 100644 --- a/src/ENGyn-Nodes/Navisworks/GetDocument.cs +++ b/src/ENGyn-Nodes/Navisworks/GetDocument.cs @@ -1,12 +1,7 @@ -using System.Windows.Controls; -using System.Xml; -using Autodesk.Navisworks.Api; -using TUM.CMS.VplControl.Nodes; -using TUM.CMS.VplControl.Core; -using System.Windows.Data; +using Autodesk.Navisworks.Api; using System.Windows; -using System.Linq; -using Autodesk.Navisworks.Api.Clash; +using TUM.CMS.VplControl.Core; +using Application = Autodesk.Navisworks.Api.Application; namespace ENGyn.Nodes.Navisworks { @@ -15,7 +10,7 @@ public class CurrentDocument : Node public CurrentDocument(VplControl hostCanvas) : base(hostCanvas) { - + AddOutputPortToNode("NW Document", typeof(object)); AddInputPortToNode("NW Object", typeof(object)); @@ -34,16 +29,16 @@ public override void Calculate() { //Just a place holder. Gives the hability to connect the node to a lower stage in the execution tree var input = InputPorts[0].Data; - - OutputPorts[0].Data = GetDocument(); + + OutputPorts[0].Data = GetDocument(); } public object GetDocument() { - return Autodesk.Navisworks.Api.Application.ActiveDocument; - + return Application.ActiveDocument; + } @@ -54,7 +49,7 @@ public override Node Clone() Top = Top, Left = Left }; - + } } diff --git a/src/ENGyn-Nodes/Selection/GetElementFromSearch.cs b/src/ENGyn-Nodes/Selection/GetElementFromSearch.cs index a3b9712..01cd171 100644 --- a/src/ENGyn-Nodes/Selection/GetElementFromSearch.cs +++ b/src/ENGyn-Nodes/Selection/GetElementFromSearch.cs @@ -1,13 +1,6 @@ -using System.Windows.Controls; -using System.Xml; -using Autodesk.Navisworks.Api; -using TUM.CMS.VplControl.Nodes; -using Autodesk.Navisworks.Api.Clash; -using TUM.CMS.VplControl.Core; -using System.Windows.Data; - +using Autodesk.Navisworks.Api; using System.Collections.Generic; -using System.Windows; +using TUM.CMS.VplControl.Core; namespace ENGyn.Nodes.Selection { @@ -16,7 +9,7 @@ public class GetElementFromSearch : Node public GetElementFromSearch(VplControl hostCanvas) : base(hostCanvas) { - + AddInputPortToNode("SelectionSets", typeof(object)); AddOutputPortToNode("Output", typeof(object)); @@ -33,7 +26,7 @@ public override void Calculate() if (input != null) { - + var type = input.GetType(); if (type == typeof(SelectionSet)) @@ -46,12 +39,12 @@ public override void Calculate() } - if (MainTools.IsList(input) && MainTools.ListContainsType(input,typeof( SelectionSet))) + if (MainTools.IsList(input) && MainTools.ListContainsType(input, typeof(SelectionSet))) { foreach (var item in input as List) { var selectionSet = item as SelectionSet; - + ModelItemCollection searchResults = selectionSet.Search.FindAll(Autodesk.Navisworks.Api.Application.ActiveDocument, false); output.Add(searchResults); @@ -59,7 +52,7 @@ public override void Calculate() } } - var objects = new List(); + var objects = new List(); foreach (var item in output) { List modelitems = new List(); @@ -73,7 +66,7 @@ public override void Calculate() } - + public override Node Clone() { diff --git a/src/ENGyn-Nodes/packages.config b/src/ENGyn-Nodes/packages.config index 3562459..f0cac64 100644 --- a/src/ENGyn-Nodes/packages.config +++ b/src/ENGyn-Nodes/packages.config @@ -3,7 +3,7 @@ - + \ No newline at end of file diff --git a/src/ENGyn.sln b/src/ENGyn.sln index 7fd425e..fd89cd8 100644 --- a/src/ENGyn.sln +++ b/src/ENGyn.sln @@ -47,45 +47,81 @@ Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Debug|x64 = Debug|x64 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {0CF6E1A1-FD98-41C4-B377-3C7324361B63}.Debug|Any CPU.ActiveCfg = Autodesk Navisworks Manage 2018|Any CPU {0CF6E1A1-FD98-41C4-B377-3C7324361B63}.Debug|Any CPU.Build.0 = Autodesk Navisworks Manage 2018|Any CPU {0CF6E1A1-FD98-41C4-B377-3C7324361B63}.Debug|x64.ActiveCfg = Autodesk Navisworks Manage 2017|x64 + {0CF6E1A1-FD98-41C4-B377-3C7324361B63}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0CF6E1A1-FD98-41C4-B377-3C7324361B63}.Release|x64.ActiveCfg = Release|x64 + {0CF6E1A1-FD98-41C4-B377-3C7324361B63}.Release|x64.Build.0 = Release|x64 {03FEEE33-461A-45B4-BD6F-7154E58A12DB}.Debug|Any CPU.ActiveCfg = Autodesk Navisworks Manage 2018|Any CPU {03FEEE33-461A-45B4-BD6F-7154E58A12DB}.Debug|Any CPU.Build.0 = Autodesk Navisworks Manage 2018|Any CPU {03FEEE33-461A-45B4-BD6F-7154E58A12DB}.Debug|x64.ActiveCfg = Autodesk Navisworks Manage 2018|Any CPU + {03FEEE33-461A-45B4-BD6F-7154E58A12DB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {03FEEE33-461A-45B4-BD6F-7154E58A12DB}.Release|x64.ActiveCfg = Release|Any CPU + {03FEEE33-461A-45B4-BD6F-7154E58A12DB}.Release|x64.Build.0 = Release|Any CPU {3069A3F2-F67C-4E4D-AD8C-451AF5845E7A}.Debug|Any CPU.ActiveCfg = Release|Any CPU {3069A3F2-F67C-4E4D-AD8C-451AF5845E7A}.Debug|x64.ActiveCfg = Debug|Any CPU + {3069A3F2-F67C-4E4D-AD8C-451AF5845E7A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3069A3F2-F67C-4E4D-AD8C-451AF5845E7A}.Release|Any CPU.Build.0 = Release|Any CPU + {3069A3F2-F67C-4E4D-AD8C-451AF5845E7A}.Release|x64.ActiveCfg = Release|Any CPU + {3069A3F2-F67C-4E4D-AD8C-451AF5845E7A}.Release|x64.Build.0 = Release|Any CPU {593E9BFD-BE78-4487-9E22-76AE7DF0B84A}.Debug|Any CPU.ActiveCfg = Release|Any CPU {593E9BFD-BE78-4487-9E22-76AE7DF0B84A}.Debug|x64.ActiveCfg = Release|Any CPU + {593E9BFD-BE78-4487-9E22-76AE7DF0B84A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {593E9BFD-BE78-4487-9E22-76AE7DF0B84A}.Release|Any CPU.Build.0 = Release|Any CPU + {593E9BFD-BE78-4487-9E22-76AE7DF0B84A}.Release|x64.ActiveCfg = Release|Any CPU + {593E9BFD-BE78-4487-9E22-76AE7DF0B84A}.Release|x64.Build.0 = Release|Any CPU {A2AAA7E5-91CA-4349-8569-0A21037CE666}.Debug|Any CPU.ActiveCfg = Release|Any CPU {A2AAA7E5-91CA-4349-8569-0A21037CE666}.Debug|Any CPU.Build.0 = Release|Any CPU {A2AAA7E5-91CA-4349-8569-0A21037CE666}.Debug|x64.ActiveCfg = Release|Any CPU + {A2AAA7E5-91CA-4349-8569-0A21037CE666}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A2AAA7E5-91CA-4349-8569-0A21037CE666}.Release|x64.ActiveCfg = Release|Any CPU {DAD36D0F-38F4-4928-8BBE-34F5631C6099}.Debug|Any CPU.ActiveCfg = Release|Any CPU - {DAD36D0F-38F4-4928-8BBE-34F5631C6099}.Debug|Any CPU.Build.0 = Release|Any CPU {DAD36D0F-38F4-4928-8BBE-34F5631C6099}.Debug|x64.ActiveCfg = Release|Any CPU {DAD36D0F-38F4-4928-8BBE-34F5631C6099}.Debug|x64.Build.0 = Release|Any CPU + {DAD36D0F-38F4-4928-8BBE-34F5631C6099}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DAD36D0F-38F4-4928-8BBE-34F5631C6099}.Release|Any CPU.Build.0 = Release|Any CPU + {DAD36D0F-38F4-4928-8BBE-34F5631C6099}.Release|x64.ActiveCfg = Release|Any CPU + {DAD36D0F-38F4-4928-8BBE-34F5631C6099}.Release|x64.Build.0 = Release|Any CPU {BCF967E6-B390-4E20-A85D-1B9F0499AC7B}.Debug|Any CPU.ActiveCfg = Release|Any CPU - {BCF967E6-B390-4E20-A85D-1B9F0499AC7B}.Debug|Any CPU.Build.0 = Release|Any CPU {BCF967E6-B390-4E20-A85D-1B9F0499AC7B}.Debug|x64.ActiveCfg = Release|Any CPU {BCF967E6-B390-4E20-A85D-1B9F0499AC7B}.Debug|x64.Build.0 = Release|Any CPU + {BCF967E6-B390-4E20-A85D-1B9F0499AC7B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BCF967E6-B390-4E20-A85D-1B9F0499AC7B}.Release|Any CPU.Build.0 = Release|Any CPU + {BCF967E6-B390-4E20-A85D-1B9F0499AC7B}.Release|x64.ActiveCfg = Release|Any CPU + {BCF967E6-B390-4E20-A85D-1B9F0499AC7B}.Release|x64.Build.0 = Release|Any CPU {0C36090F-1EAD-46FF-B476-09C83A6CD2C3}.Debug|Any CPU.ActiveCfg = Autodesk Navisworks Manage 2018|Any CPU - {0C36090F-1EAD-46FF-B476-09C83A6CD2C3}.Debug|Any CPU.Build.0 = Autodesk Navisworks Manage 2018|Any CPU {0C36090F-1EAD-46FF-B476-09C83A6CD2C3}.Debug|x64.ActiveCfg = Autodesk Navisworks Manage 2018|Any CPU {0C36090F-1EAD-46FF-B476-09C83A6CD2C3}.Debug|x64.Build.0 = Autodesk Navisworks Manage 2018|Any CPU + {0C36090F-1EAD-46FF-B476-09C83A6CD2C3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0C36090F-1EAD-46FF-B476-09C83A6CD2C3}.Release|Any CPU.Build.0 = Release|Any CPU + {0C36090F-1EAD-46FF-B476-09C83A6CD2C3}.Release|x64.ActiveCfg = Release|Any CPU + {0C36090F-1EAD-46FF-B476-09C83A6CD2C3}.Release|x64.Build.0 = Release|Any CPU {75183C76-FD7C-4539-AB78-BF7E736558AF}.Debug|Any CPU.ActiveCfg = Autodesk Navisworks Manage 2018|Any CPU - {75183C76-FD7C-4539-AB78-BF7E736558AF}.Debug|Any CPU.Build.0 = Autodesk Navisworks Manage 2018|Any CPU {75183C76-FD7C-4539-AB78-BF7E736558AF}.Debug|x64.ActiveCfg = Autodesk Navisworks Manage 2018|Any CPU {75183C76-FD7C-4539-AB78-BF7E736558AF}.Debug|x64.Build.0 = Autodesk Navisworks Manage 2018|Any CPU + {75183C76-FD7C-4539-AB78-BF7E736558AF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {75183C76-FD7C-4539-AB78-BF7E736558AF}.Release|Any CPU.Build.0 = Release|Any CPU + {75183C76-FD7C-4539-AB78-BF7E736558AF}.Release|x64.ActiveCfg = Release|Any CPU + {75183C76-FD7C-4539-AB78-BF7E736558AF}.Release|x64.Build.0 = Release|Any CPU {5CFBC299-B9BB-4B8E-AE8A-C51A1AA74CAF}.Debug|Any CPU.ActiveCfg = Autodesk Navisworks Manage 2018|Any CPU - {5CFBC299-B9BB-4B8E-AE8A-C51A1AA74CAF}.Debug|Any CPU.Build.0 = Autodesk Navisworks Manage 2018|Any CPU {5CFBC299-B9BB-4B8E-AE8A-C51A1AA74CAF}.Debug|x64.ActiveCfg = Autodesk Navisworks Manage 2018|Any CPU {5CFBC299-B9BB-4B8E-AE8A-C51A1AA74CAF}.Debug|x64.Build.0 = Autodesk Navisworks Manage 2018|Any CPU + {5CFBC299-B9BB-4B8E-AE8A-C51A1AA74CAF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5CFBC299-B9BB-4B8E-AE8A-C51A1AA74CAF}.Release|Any CPU.Build.0 = Release|Any CPU + {5CFBC299-B9BB-4B8E-AE8A-C51A1AA74CAF}.Release|x64.ActiveCfg = Release|Any CPU + {5CFBC299-B9BB-4B8E-AE8A-C51A1AA74CAF}.Release|x64.Build.0 = Release|Any CPU {DEE30191-3915-450F-84FC-DDA334923860}.Debug|Any CPU.ActiveCfg = Release|Any CPU - {DEE30191-3915-450F-84FC-DDA334923860}.Debug|Any CPU.Build.0 = Release|Any CPU {DEE30191-3915-450F-84FC-DDA334923860}.Debug|x64.ActiveCfg = Release|Any CPU {DEE30191-3915-450F-84FC-DDA334923860}.Debug|x64.Build.0 = Release|Any CPU + {DEE30191-3915-450F-84FC-DDA334923860}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DEE30191-3915-450F-84FC-DDA334923860}.Release|Any CPU.Build.0 = Release|Any CPU + {DEE30191-3915-450F-84FC-DDA334923860}.Release|x64.ActiveCfg = Release|Any CPU + {DEE30191-3915-450F-84FC-DDA334923860}.Release|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -99,7 +135,7 @@ Global {DEE30191-3915-450F-84FC-DDA334923860} = {1AD8E3EE-82F0-424B-BDD5-AA06EE4F1F48} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {58CD9914-8E9C-4804-9C25-4E86EEC6B9C1} BuildVersion_StartDate = 2000/1/1 + SolutionGuid = {58CD9914-8E9C-4804-9C25-4E86EEC6B9C1} EndGlobalSection EndGlobal diff --git a/src/ENGyn/ENGyn.csproj b/src/ENGyn/ENGyn.csproj index a709f6e..71dc180 100644 --- a/src/ENGyn/ENGyn.csproj +++ b/src/ENGyn/ENGyn.csproj @@ -74,51 +74,16 @@ x64 MinimumRecommendedRules.ruleset + + ..\..\bin\2018\ + + + bin\Release\ + + + bin\x64\Release\ + - - ..\packages\Navisworks-2018-2019-x64-API.1.0.1\lib\net47\AdWindows.dll - False - - - ..\packages\Navisworks-2018-2019-x64-API.1.0.1\lib\net47\Autodesk.Navisworks.Api.dll - False - - - ..\packages\Navisworks-2018-2019-x64-API.1.0.1\lib\net47\Autodesk.Navisworks.Automation.dll - False - - - ..\packages\Navisworks-2018-2019-x64-API.1.0.1\lib\net47\Autodesk.Navisworks.Clash.dll - False - - - ..\packages\Navisworks-2018-2019-x64-API.1.0.1\lib\net47\Autodesk.Navisworks.ComApi.dll - False - - - ..\packages\Navisworks-2018-2019-x64-API.1.0.1\lib\net47\Autodesk.Navisworks.Controls.dll - False - - - ..\packages\Navisworks-2018-2019-x64-API.1.0.1\lib\net47\Autodesk.Navisworks.Interop.ComApi.dll - True - - - ..\packages\Navisworks-2018-2019-x64-API.1.0.1\lib\net47\Autodesk.Navisworks.Interop.Timeliner.dll - True - - - ..\packages\Navisworks-2018-2019-x64-API.1.0.1\lib\net47\Autodesk.Navisworks.Resolver.dll - False - - - ..\packages\Navisworks-2018-2019-x64-API.1.0.1\lib\net47\Autodesk.Navisworks.Takeoff.dll - False - - - ..\packages\Navisworks-2018-2019-x64-API.1.0.1\lib\net47\Autodesk.Navisworks.Timeliner.dll - False - ..\packages\Navisworks-2018-2019-x64-API.1.0.1\lib\net47\navisworks.gui.common.dll False @@ -417,17 +382,14 @@ --> - IF EXIST "C:\Program Files\Autodesk\$(ConfigurationName)\Plugins\$(TargetName)\" rmdir /S /Q "C:\Program Files\Autodesk\$(ConfigurationName)\Plugins\$(TargetName)\" -IF EXIST "%25APPDATA%25\$(ConfigurationName)\Plugins\$(TargetName)\" rmdir /S /Q "%25APPDATA%25\$(ConfigurationName)\Plugins\$(TargetName)\" - -xcopy /Y /e "$(OutDir)*.*" "%25APPDATA%25\$(ConfigurationName)\Plugins\$(TargetName)\" - + IF EXIST "C:\Program Files\Autodesk\Autodesk Navisworks Manage 2018\Plugins\$(TargetName)\" rmdir /S /Q "C:\Program Files\Autodesk\Autodesk Navisworks Manage 2018\Plugins\$(TargetName)\" +IF EXIST "%25APPDATA%25\Autodesk Navisworks Manage 2018\Plugins\$(TargetName)\" rmdir /S /Q "%25APPDATA%25\Autodesk Navisworks Manage 2018\Plugins\$(TargetName)\" - xcopy /Y "$(ProjectDir)ENGyn.xaml" "$(OutDir)\en-US\" - xcopy /Y "$(ProjectDir)ENGyn.xaml" "%25APPDATA%25\$(ConfigurationName)\Plugins\$(TargetName)\en-US\" + xcopy /Y "$(ProjectDir)ENGyn.xaml" "$(TargetDir)en-US\" +xcopy /Y "$(ProjectDir)Images\ENGyn.png" "$(TargetDir)Images\" -xcopy /Y "$(ProjectDir)Images\ENGyn.png" "%25APPDATA%25\$(ConfigurationName)\Plugins\$(TargetName)\Images\" + xcopy /Y /e "$(TargetDir)*.*" "%25APPDATA%25\Autodesk Navisworks Manage 2018\Plugins\$(TargetName)\" diff --git a/src/ENGyn/packages.config b/src/ENGyn/packages.config index df60c5f..8da4113 100644 --- a/src/ENGyn/packages.config +++ b/src/ENGyn/packages.config @@ -2,7 +2,6 @@ - \ No newline at end of file