Exemple #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();
        }
Exemple #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);
                }
            }
        }
Exemple #3
0
 private void MouseEventsSink_OnMouseUp(Inventor.MouseButtonEnum Button, Inventor.ShiftStateEnum ShiftKeys, Inventor.Point ModelPosition, Inventor.Point2d ViewPosition, Inventor.View View)
 {
 }
Exemple #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");
 }
Exemple #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");
 }
Exemple #6
0
 private void UserInputEvents_OnStopPreSelect(Inventor.Point ModelPosition, Inventor.Point2d ViewPosition, Inventor.View View)
 {
     //MessageBox.Show("On Stop PreSelect");
 }
Exemple #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");
 }
Exemple #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]);
                    }
                }
            }
        }