コード例 #1
0
ファイル: Form1.cs プロジェクト: razorcx/search-tekla-model
        private void buttonSearch_Click(object sender, EventArgs e)
        {
            //searching for member part mark
            var searchValue = textBoxSearch.Text;

            ModelObjectEnumerator.AutoFetch = true;
            var modelObjects = new Model().GetModelObjectSelector()
                               .GetAllObjectsWithType(ModelObject.ModelObjectEnum.BEAM)
                               .ToList()
                               .OfType <Beam>()
                               .ToList();

            var beams = modelObjects
                        .Where(b => b.GetPartMark()
                               .Contains(searchValue))
                        .ToList();

            beams.ForEach(b =>
            {
                var drawer   = new GraphicsDrawer();
                var color    = new Tekla.Structures.Model.UI.Color(1, 1, 1);
                var location = b.GetCoordinateSystem().Origin;
                drawer.DrawText(location, b.GetPartMark(), color);
            });
        }
コード例 #2
0
 public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 {
     Tekla.Structures.Model.UI.Color teklaColor = value as Tekla.Structures.Model.UI.Color;
     System.Windows.Media.Color      color      = new System.Windows.Media.Color();
     color.ScA = (float)teklaColor.Transparency;
     color.ScR = (float)teklaColor.Red;
     color.ScG = (float)teklaColor.Green;
     color.ScB = (float)teklaColor.Blue;
     return(color);
 }
コード例 #3
0
        private void DrawCoordinateSystem()
        {
            TSM.UI.GraphicsDrawer drawer = new TSM.UI.GraphicsDrawer();

            TSG.Point    origin = new TSG.Point();
            TSG.Point    pointX = new TSG.Point(3000, 0, 0);
            TSG.Point    pointY = new TSG.Point(0, 3000, 0);
            TSG.Point    pointZ = new TSG.Point(0, 0, 3000);
            TSM.UI.Color blue   = new TSM.UI.Color(0, 0, 1);
            TSM.UI.Color red    = new TSM.UI.Color(1, 0, 0);

            drawer.DrawText(pointX, "X", blue);
            drawer.DrawText(pointY, "Y", blue);
            drawer.DrawText(pointZ, "Z", blue);

            drawer.DrawLineSegment(origin, pointX, red);
            drawer.DrawLineSegment(origin, pointY, red);
            drawer.DrawLineSegment(origin, pointZ, red);
        }