Пример #1
0
        private void SetViewDirection(Inventor.Face FaceView)
        {
            Inventor.Camera Camera = mInvApplication.ActiveView.Camera;
            Inventor.Point  Pnt;
            Inventor.View   PlaneView = mInvApplication.ActiveView;
            //  ' Set Eye or Target
            if (FaceView.IsParamReversed)
            {
                Pnt = Camera.Eye.Copy();
                Pnt.TranslateBy(GetMidPointAtFaceNormal(ref FaceView).AsVector());
                Camera.Target = Pnt;
            }
            else
            {
                Pnt = Camera.Target.Copy();
                Pnt.TranslateBy(GetMidPointAtFaceNormal(ref FaceView).AsVector());
                Camera.Eye = Pnt;
            }

            Camera.UpVector = GetLargestEdgeUnitVector(ref FaceView);
            Camera.Fit();
            Camera.Apply();
            PlaneView.SetCurrentAsTop();
            PlaneView.SetCurrentAsHome(true);
            PlaneView.Update();
        }
Пример #2
0
        private void UserInputEvents_OnSelect(Inventor.ObjectsEnumerator JustSelectedEntities, ref Inventor.ObjectCollection MoreSelectedEntities, Inventor.SelectionDeviceEnum SelectionDevice, Inventor.Point ModelPosition, Inventor.Point2d ViewPosition, Inventor.View View)
        {
            if (View.Parent != null)
            {
                Inventor.Document Document = (Inventor.Document)View.Parent;
                if (Document.DocumentType == Inventor.DocumentTypeEnum.kAssemblyDocumentObject)
                {
                    Inventor.AssemblyDocument AssemblyDocument = (Inventor.AssemblyDocument)Document;

                    OnSelectionChange(ref AssemblyDocument, ref MoreSelectedEntities);
                }
                else
                {
                    Inventor.AssemblyDocument AssemblyDocument = null;
                    JustSelectedEntities = null;
                    OnSelectionChange(ref AssemblyDocument, ref MoreSelectedEntities);
                }
            }
        }
Пример #3
0
 private void MouseEventsSink_OnMouseUp(Inventor.MouseButtonEnum Button, Inventor.ShiftStateEnum ShiftKeys, Inventor.Point ModelPosition, Inventor.Point2d ViewPosition, Inventor.View View)
 {
 }
Пример #4
0
 private void UserInputEvents_OnPreSelect(ref object PreSelectEntity, out bool DoHighlight, ref Inventor.ObjectCollection MorePreSelectEntities, Inventor.SelectionDeviceEnum SelectionDevice, Inventor.Point ModelPosition, Inventor.Point2d ViewPosition, Inventor.View View)
 {
     DoHighlight = true;
     //roll over
     // MessageBox.Show("On PreSelect");
 }
Пример #5
0
 private void UserInputEvents_OnUnSelect(Inventor.ObjectsEnumerator UnSelectedEntities, Inventor.SelectionDeviceEnum SelectionDevice, Inventor.Point ModelPosition, Inventor.Point2d ViewPosition, Inventor.View View)
 {
     // MessageBox.Show("On UnSelect");
 }
Пример #6
0
 private void UserInputEvents_OnStopPreSelect(Inventor.Point ModelPosition, Inventor.Point2d ViewPosition, Inventor.View View)
 {
     //MessageBox.Show("On Stop PreSelect");
 }
Пример #7
0
 private void UserInputEvents_OnDoubleClick(Inventor.ObjectsEnumerator SelectedEntities, Inventor.SelectionDeviceEnum SelectionDevice, Inventor.MouseButtonEnum Button, Inventor.ShiftStateEnum ShiftKeys, Inventor.Point ModelPosition, Inventor.Point2d ViewPosition, Inventor.View View, Inventor.NameValueMap AdditionalInfo, out Inventor.HandlingCodeEnum HandlingCode)
 {
     HandlingCode = Inventor.HandlingCodeEnum.kEventHandled;
     //MessageBox.Show("On Double Click");
 }
Пример #8
0
        private void UserInputEvents_OnSelect(Inventor.ObjectsEnumerator JustSelectedEntities, ref Inventor.ObjectCollection MoreSelectedEntities, Inventor.SelectionDeviceEnum SelectionDevice, Inventor.Point ModelPosition, Inventor.Point2d ViewPosition, Inventor.View View)
        {
            if (View.Parent != null)
            {
                Inventor.Document         Document         = (Inventor.Document)View.Parent;
                Inventor.AssemblyDocument AssemblyDocument = (Inventor.AssemblyDocument)Document;

                if (JustSelectedEntities.Count > 0)
                {
                    for (int i = JustSelectedEntities.Count; i >= 1; i--)
                    {
                        GetInventorObjType(JustSelectedEntities[i]);
                    }
                }
            }
        }