Skip to content

Commit

Permalink
Merge branch 'testing' of https://github.com/ENGworks-DEV/ENGyn into …
Browse files Browse the repository at this point in the history
…testing
  • Loading branch information
pabloderen committed Dec 18, 2018
2 parents cf4e4fa + b62c151 commit 2a58447
Showing 1 changed file with 7 additions and 20 deletions.
27 changes: 7 additions & 20 deletions src/ENGyn-Nodes/Selection/GetSelection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,31 +62,18 @@ public GetSelectionByGUID(VplControl hostCanvas)

public override void Calculate()
{
if (InputPorts[0].Data != null && InputPorts[0].Data is Document)
{
Document doc = InputPorts[0].Data as Document;
var sel = doc.CurrentSelection.SelectedItems;
List<object> modelItems = new List<object>();
foreach (var s in sel)
{
modelItems.Add(s);
}
OutputPorts[0].Data = modelItems;
}

OutputPorts[0].Data = MainTools.RunFunction(GetModelItemByGUID, InputPorts);

}
public object GetModelItemByGUID(object GUID)
{
// create a search class
Application.ActiveDocument.CurrentSelection.SelectAll();


var modelItems = Application.ActiveDocument.CurrentSelection.SelectedItems ;

Search search = new Search();
search.Selection.SelectAll();
SearchCondition searchCondition = SearchCondition.HasPropertyByName("LcOaNode","LcOaNodeGuid").EqualValue(VariantData.FromDisplayString(GUID.ToString()));
search.SearchConditions.Add(searchCondition);

modelItems.Where(searchCondition);


ModelItemCollection modelItems = search.FindAll(Application.ActiveDocument, false);
if(modelItems.Count > 0)
{
return modelItems.First;
Expand Down

0 comments on commit 2a58447

Please sign in to comment.