MeasureManagerGetStyle Method |
Namespace: VIZCore3D.NET.Manager
// VIZCore3D.NET Control private VIZCore3D.NET.VIZCore3DControl vizcore3d; private void Example() { // Add Event vizcore3d.Review.OnReviewChangedEvent += Review_OnReviewChangedEvent; // Get Default Style VIZCore3D.NET.Data.MeasureStyle style = vizcore3d.Review.Measure.GetStyle(); style.Prefix = true; style.Frame = true; style.DX_DY_DZ = true; style.Unit = true; style.UnitKind = Data.MeasureUnitKind.RUT_MILLIMETER; style.NumberOfDecimalPlaces = 2; style.ContinuousDistance = true; style.PickPosition = true; style.BackgroundTransparent = false; style.BackgroundColor = System.Drawing.Color.Blue; style.FontColor = System.Drawing.Color.White; style.FontSize = Data.FontSizeKind.SIZE12; style.LineColor = System.Drawing.Color.White; style.LineWidth = 2; style.ArrowColor = System.Drawing.Color.Red; style.ArrowSize = 4; style.AssistantLine = true; style.AssistantLineStyle = Data.MeasureStyle.AssistantLineType.DOTTEDLINE; style.AssistantLineCount = -1; style.AlignDistanceText = true; style.AlignDistanceTextPosition = 1; style.AlignDistanceTextMargine = 5; // Set Default Style vizcore3d.Review.Measure.SetStyle(style); // Measure vizcore3d.Review.Measure.AddMeasure(); } private void Review_OnReviewChangedEvent(object sender, Event.EventManager.ReviewEventArgs e) { if(e.EventKind == Manager.ReviewManager.ReviewEventKind.CHANGED_REVIEW_DATA) { // Case 1 Data.ReviewItem review = vizcore3d.Review.GetItem(e.ReviewID); foreach (Data.ReviewPosition item in review.Position) { string str = string.Format( "KIND: {0} / TYPE: {1} / TEXT: {2} / PT: {3}" , item.Kind , item.TypeText , item.Text , item.Position == null ? "" : item.Position.ToString() ); } // Case 2 Data.MeasureItem measure = vizcore3d.Review.Measure.GetItem(e.ReviewID); foreach (Data.ReviewPosition item in measure.Position) { string str = string.Format( "KIND: {0} / TYPE: {1} / TEXT: {2} / PT: {3}" , item.Kind , item.TypeText , item.Text , item.Position == null ? "" : item.Position.ToString() ); } } }