Esempio n. 1
0
 private Inventor.WorkPlane GetAssemblyDocumentWorkPlane(ref Inventor.AssemblyDocument AssemblyDocument, string WorkPlaneAffix, string WorkPlaneSuffix)
 {
     Inventor.WorkPlane DefaultWorkPlane = null;
     if (WorkPlaneSuffix != "")
     {
         foreach (Inventor.WorkPlane WorkPlane in AssemblyDocument.ComponentDefinition.WorkPlanes)
         {
             if (WorkPlane.Name == WorkPlaneAffix + " Plane")
             {
                 return(WorkPlane);
             }
         }
         System.Windows.Forms.MessageBox.Show("Work Plane Not Fiound Affix: " + WorkPlaneAffix);
         return(DefaultWorkPlane);
     }
     else
     {
         foreach (Inventor.WorkPlane WorkPlane in AssemblyDocument.ComponentDefinition.WorkPlanes)
         {
             if (WorkPlane.Name == WorkPlaneAffix + " " + WorkPlaneSuffix)
             {
                 return(WorkPlane);
             }
         }
         System.Windows.Forms.MessageBox.Show("Work Plane Not Fiound: Affix " + WorkPlaneAffix + " Suffix " + WorkPlaneSuffix);
         return(DefaultWorkPlane);
     }
 }
Esempio n. 2
0
        private void CreateConstraints(ref Inventor.AssemblyDocument AssemblyDocument, ref Inventor.ComponentOccurrence BaseComponentOccurrence, Inventor.ComponentOccurrence PositionComponentOccurrence, string BaseWorkPlaneName, string PositionMateWorkPlaneName, string Affix, string Seperator, string Suffix)
        {
            Inventor.WorkPlane BaseWorkPlane     = null;
            Inventor.WorkPlane PositionWorkPlane = null;

            BaseWorkPlane     = GetAssemblyDocumentWorkPlane(ref AssemblyDocument, "", "");
            PositionWorkPlane = GetAssemblyDocumentWorkPlane(ref AssemblyDocument, "", "");
            if (BaseWorkPlane.Type == Inventor.ObjectTypeEnum.kWorkPlaneObject && PositionWorkPlane.Type == Inventor.ObjectTypeEnum.kWorkPlaneObject)
            {
            }
        }
Esempio n. 3
0
        private Inventor.WorkPlane GetPartDocumentWorkPlane(ref Inventor.PartDocument PartDocument, string WorkPlaneAffix)
        {
            Inventor.WorkPlane DefaultWorkPlane = PartDocument.ComponentDefinition.WorkPlanes[3];

            foreach (Inventor.WorkPlane WorkPlane in PartDocument.ComponentDefinition.WorkPlanes)
            {
                if (WorkPlane.Name == WorkPlaneAffix + " Plane")
                {
                    return(WorkPlane);
                }
            }
            return(DefaultWorkPlane);
        }
Esempio n. 4
0
        private Inventor.WorkPlane GetAssemblyDocumentWorkPlane(ref Inventor.AssemblyDocument AssemblyDocument, string WorkPlaneSuffix)
        {
            Inventor.WorkPlane DefaultWorkPlane = AssemblyDocument.ComponentDefinition.WorkPlanes[3];

            foreach (Inventor.WorkPlane WorkPlane in AssemblyDocument.ComponentDefinition.WorkPlanes)
            {
                if (WorkPlane.Name == WorkPlaneSuffix + " Plane")
                {
                    return(WorkPlane);
                }
            }
            return(DefaultWorkPlane);
        }