Example #1
0
        public static Inventor.ClientGraphics DeleteNamedGraphics(ref Inventor.AssemblyDocument assemblyDocument, string Name)//, Inventor.ClientGraphics oClientGraphics)
        {
            Inventor.ClientGraphics ClientGraphics = null;
            try
            {
                ClientGraphics = assemblyDocument.ComponentDefinition.ClientGraphicsCollection[Name];
                if (ClientGraphics != null)
                {
                    ClientGraphics.Delete();
                }
            }
            catch
            { }

            return(ClientGraphics);
        }
Example #2
0
        private static Inventor.ClientGraphics DeleteClientGraphics(ref Inventor.AssemblyDocument assemblyDocument, ref Inventor.AssemblyComponentDefinition CompDef)//, Inventor.ClientGraphics oClientGraphics)
        {
            CompDef = assemblyDocument.ComponentDefinition;
            Inventor.ClientGraphics ClientGraphics = null;
            try
            {
                ClientGraphics = CompDef.ClientGraphicsCollection["CG_Test"];
                if (ClientGraphics != null)
                {
                    ClientGraphics.Delete();
                }
            }
            catch
            { }

            return(ClientGraphics);
        }
Example #3
0
        //public CClientGraphic(ref Inventor.AssemblyDocument assemblyDocument)
        //{
        //   // Inventor.ClientGraphicsCollection clientGraphicsCollection;
        //    //ClientGraphics

        //}

        public static void DrawRangBox(ref Inventor.Application Inv_Application, ref Inventor.AssemblyDocument assemblyDocument, Inventor.ObjectsEnumerator justSelectedEntities)
        {
            //Inventor.ComponentDefinition componentDefinition = (Inventor.ComponentDefinition)assemblyDocument.ComponentDefinition;
            if (justSelectedEntities.Count >= 1)
            {
                if (assemblyDocument.GraphicsDataSetsCollection.Count >= 1)
                {
                }
                else
                {
                    Inventor.ClientGraphics clientGraphics = assemblyDocument.ComponentDefinition.ClientGraphicsCollection["RangeID"];
                    assemblyDocument.GraphicsDataSetsCollection["RangeID"].Delete();
                    clientGraphics.Delete();
                }
            }
            else
            {
                return;
            }
        }
Example #4
0
        public static void DrawRangeBoxs(ref Inventor.Application Inv_Application, ref Inventor.AssemblyDocument assemblyDocument, Inventor.ObjectsEnumerator justSelectedEntities)
        {
            //Inventor.ComponentDefinition componentDefinition = (Inventor.ComponentDefinition)assemblyDocument.ComponentDefinition;

            if (justSelectedEntities.Count >= 1)
            {
                if (assemblyDocument.GraphicsDataSetsCollection.Count >= 1)
                {
                    int length = justSelectedEntities.Count;
                    for (int i = length - 1; i >= 0; i--)
                    {
                        if (GetInventorObjType(justSelectedEntities[i]) == Inventor.ObjectTypeEnum.kComponentOccurrenceObject)
                        {
                            Inventor.Box box = null;
                            System.Diagnostics.Debug.WriteLine("Just Selected");
                            Inventor.ComponentOccurrence componentOccurrence = justSelectedEntities[i];
                            box = componentOccurrence.RangeBox;
                        }
                        //else if (GetInventorObjType(justSelectedEntities[i]) == Inventor.ObjectTypeEnum.kRectangularOccurrencePatternObject)
                        //{
                        //    Inventor.OccurrencePattern OccurrencePattern = justSelectedEntities[i];
                        //    int PatternLength = 10;
                        //    for (int x = PatternLength - 1; x >= 1; x--)
                        //    {
                        //    }
                        //} use after idea tested
                    }
                }
                else
                {
                    Inventor.ClientGraphics clientGraphics = assemblyDocument.ComponentDefinition.ClientGraphicsCollection["RangeID"];
                    assemblyDocument.GraphicsDataSetsCollection["RangeID"].Delete();
                    clientGraphics.Delete();
                }
            }
            else
            {
                return;
            }
        }