Beispiel #1
0
        public Inventor.Camera GetDocument(ref Inventor._Document Document, ref Inventor.Application invApplication)
        {
            Inventor.PartDocument PartDocument = null;
            Inventor.Camera       Camera       = null;
            mInvApplication = invApplication;
            if (Document.DocumentType == Inventor.DocumentTypeEnum.kPartDocumentObject)
            {
                PartDocument = (Inventor.PartDocument)Document;

                if (PartDocument != null)
                {
                    if (PartDocument.ComponentDefinitions.Count > 0)
                    {
                        Camera = mInvApplication.ActiveView.Camera;
                        Inventor.PartComponentDefinition PartComponentDefinition = PartDocument.ComponentDefinitions[1];

                        foreach (Inventor.SurfaceBody SurfaceBody in PartComponentDefinition.SurfaceBodies)
                        {
                            GetFaceToView(SurfaceBody, ref PartDocument, ref Camera);
                        }
                        return(Camera);
                    }
                }
            }
            return(Camera);
        }
Beispiel #2
0
        private static void UnlockViews(Inventor.PartDocument partDocument)
        {
            Inventor.PartComponentDefinition partComponentDefinition = partDocument.ComponentDefinition;

            if (partComponentDefinition.RepresentationsManager.DesignViewRepresentations.Count >= 1)
            {
                foreach (Inventor.DesignViewRepresentation designViewRepresentation in partComponentDefinition.RepresentationsManager.DesignViewRepresentations)
                {
                    try
                    {
                        designViewRepresentation.Locked = false;
                    }
                    catch (Exception)
                    { }
                }
            }
        }