Ejemplo n.º 1
0
        private void DgvFields_SelectionChanged(object sender, EventArgs e)
        {
            // выделить(подсветить) объект задания в модели для пользователя
            selectionTranContainer?.Reset();

            foreach (DataGridViewRow row in dgvFields.SelectedRows)
            {
                PenetrTask task = (PenetrTask)dgvFields.Rows[row.Index].DataBoundItem;

                BCOM.ModelReference modelRef =
                    Addin.App.MdlGetModelReferenceFromModelRefP((int)task.modelRefP);

                BCOM.View view = ViewHelper.getActiveView();

                List <long> itemsIds = new List <long> {
                    task.elemId
                };
                // добавляем фланцы:
                foreach (PenetrTaskFlange flangeTask in task.FlangesGeom)
                {
                    itemsIds.Add(flangeTask.elemId);
                }

                foreach (long id in itemsIds)
                {
                    BCOM.Element el = modelRef.GetElementByID(id);
                    el.Color      = 2; // зелёный
                    el.LineWeight = 5;

                    // для ОТЛАДКИ *************************************************
                    //BCOM.Transform3d taskTran;
                    //{
                    //    BCOM.Point3d origin = (el as BCOM.CellElement).Origin;

                    //    var shift = Addin.App.Vector3dSubtractPoint3dPoint3d(
                    //        Addin.App.Point3dZero(), task.Location);

                    //    el.Move(Addin.App.Point3dFromXYZ(shift.X, shift.Y, shift.Z));

                    //    taskTran = Addin.App.Transform3dInverse(
                    //        Addin.App.Transform3dFromMatrix3d(task.Rotation));

                    //    el.Transform(taskTran);
                    //    el.Move(task.Location);
                    //}
                    //**************************************************************

                    selectionTranContainer.AppendCopyOfElement(el);
                }

                view.Redraw();
            }
        }
Ejemplo n.º 2
0
 public void Accept(BCOM.Element Element, ref BCOM.Point3d Point, BCOM.View View)
 {
     View.Redraw();
 }