Example #1
0
        /// <summary>
        /// HeghlightElements(List<Elm>elements, color) - change color of elements in list 
        /// </summary>
        /// <param name="elements"></param>
        /// <param name="color"></param>
        public void HighlightElements(Dictionary<string, Elm> els, int color = 1)
        {
            Log.set("TS_OpenAPI.HighLightElements");
            TSM.ModelObjectSelector selector = model.GetModelObjectSelector();
            System.Type[] Types = new System.Type[1];
            Types.SetValue(typeof(Part), 0);

            TSM.ModelObjectEnumerator objectList = selector.GetAllObjectsWithType(Types);
            int totalCnt = objectList.GetSize();

            var colorObjects = new List<ModelObject>();

            while (objectList.MoveNext())
            {
                TSM.Part myPart = objectList.Current as TSM.Part;
                if (myPart != null)
                {
                    string guid = string.Empty;
                    myPart.GetReportProperty("GUID", ref guid);
                    if (els.ContainsKey(guid)) colorObjects.Add(myPart);
                }
            }
            var _color = new Color(0.0, 0.0, 1.0);
            ModelObjectVisualization.SetTransparencyForAll(TemporaryTransparency.SEMITRANSPARENT);
            ModelObjectVisualization.SetTemporaryState(colorObjects, _color);
            log.Info("\tTotal elements without price = " + colorObjects.Count);
            Log.exit();
        }
Example #2
0
 public void HighlightElements(Dictionary<string, Elm> els, int color = 1)
 {
     DateTime t0 = DateTime.Now;
     Log.set("TS_OpenAPI.HighLightElements");
     colorObjects = new List<TSM.ModelObject>();
     foreach (var elm in els)
     {
         Identifier id = new Identifier(elm.Key);
         var obj = model.SelectModelObject(id);
         colorObjects.Add(obj);
     }
     DateTime t1 = DateTime.Now;
     var _color = new Color(0.0, 0.0, 1.0);
     ModelObjectVisualization.SetTransparencyForAll(TemporaryTransparency.SEMITRANSPARENT);
     ModelObjectVisualization.SetTemporaryState(colorObjects, _color);
     DateTime t2 = DateTime.Now;
     string timing = string.Format("=== HighLight fill colorObject t={0}, Tekla t={1}", t1 - t0, t2 - t1);
     Log.exit();
 }
Example #3
0
 public void HighlightClear()
 {
     ModelObjectVisualization.SetTransparencyForAll(TemporaryTransparency.VISIBLE);
 }