• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Inventor类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Inventor的典型用法代码示例。如果您正苦于以下问题:C# Inventor类的具体用法?C# Inventor怎么用?C# Inventor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Inventor类属于命名空间,在下文中一共展示了Inventor类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: CSimpleInteraction

		public CSimpleInteraction(Inventor.Application oApplication)
		{
			
			mApplication = oApplication;
			
			//Initialize events
			mInteractionEvents = mApplication.CommandManager.CreateInteractionEvents();
			mSelectEvents = mInteractionEvents.SelectEvents;
			
			//Set event handler VB.Net Style
			mSelectEvents.OnSelect += new Inventor.SelectEventsSink_OnSelectEventHandler(this.mSelectEvents_OnSelect);
			mInteractionEvents.OnTerminate += new Inventor.InteractionEventsSink_OnTerminateEventHandler(this.mInteractionEvents_OnTerminate);
			
			//Clear filter and set new ones if needed
			mSelectEvents.ClearSelectionFilter();
			
			//Always Disable mouse move if not needed for performances
			mSelectEvents.MouseMoveEnabled = false;
			mSelectEvents.Enabled = true;
			mSelectEvents.SingleSelectEnabled = true;
			
			//Remember to Start/Stop the interaction event
			mInteractionEvents.Start();
			
		}
开发者ID:derzzle,项目名称:INV2016_TRN,代码行数:25,代码来源:CSimpleInteraction.cs


示例2: CreateExtrudeFeature

        public void CreateExtrudeFeature(Inventor.Application ThisApplication)
        {
            PartDocument partDoc;
            partDoc = (PartDocument)ThisApplication.Documents.Add(DocumentTypeEnum.kPartDocumentObject,
                ThisApplication.GetTemplateFile(DocumentTypeEnum.kPartDocumentObject, SystemOfMeasureEnum.kDefaultSystemOfMeasure, DraftingStandardEnum.kGB_DraftingStandard, null), true);

            PlanarSketch sketch;
            sketch = partDoc.ComponentDefinition.Sketches.Add(partDoc.ComponentDefinition.WorkPlanes[3], false);

            TransientGeometry transGeom;
            transGeom = ThisApplication.TransientGeometry;

            SketchPoints skPnts;
            skPnts = sketch.SketchPoints;
            skPnts.Add(transGeom.CreatePoint2d(0, 0), false);
            skPnts.Add(transGeom.CreatePoint2d(1, 0), false);
            skPnts.Add(transGeom.CreatePoint2d(1, 1), false);

            SketchLines lines;
            lines = sketch.SketchLines;
            System.Array Line = System.Array.CreateInstance(typeof(SketchLine), 3);
            SketchLine[] line = Line as SketchLine[];
            line[0] = lines.AddByTwoPoints(skPnts[1], skPnts[2]);
            line[1] = lines.AddByTwoPoints(skPnts[2], skPnts[3]);
            line[2] = lines.AddByTwoPoints(skPnts[3], skPnts[1]);

            Profile profile;
            profile = sketch.Profiles.AddForSolid(true, null, null);

            ExtrudeFeature extFeature;
            extFeature = partDoc.ComponentDefinition.Features.ExtrudeFeatures.AddByDistanceExtent(
                profile,1.0, PartFeatureExtentDirectionEnum.kPositiveExtentDirection,PartFeatureOperationEnum.kJoinOperation,null);
            ThisApplication.ActiveView.Fit(true);
        }
开发者ID:guchanghai,项目名称:Cut,代码行数:34,代码来源:myFeature.cs


示例3: ContextNarrowing

        public void ContextNarrowing()
        {
            Inventor context = new Inventor("Nikola Tesla", new DateTime(1856, 7, 9), "Serbian");
            
            ConditionValidator cv1 = new ConditionValidator("DOB.Year == 1856", null);
            ConditionValidator cv2 = new ConditionValidator("Year == 1856", null);
            
            StaticListableObjectFactory factory = new StaticListableObjectFactory();
            factory.AddObject("cv1", cv1);
            factory.AddObject("cv2", cv2);

            ValidatorReference v1 = new ValidatorReference();
            v1.ObjectFactory = factory;
            v1.Name = "cv1";

            IValidationErrors errors = new ValidationErrors();

            Assert.IsTrue(v1.Validate(context, null, errors));
            Assert.IsTrue(v1.Validate(context, errors));

            ValidatorReference v2 = new ValidatorReference();
            v2.ObjectFactory = factory;
            v2.Name = "cv2";
            v2.Context = Expression.Parse("DOB");

            Assert.IsTrue(v2.Validate(context, null, errors));
            Assert.IsTrue(v2.Validate(context, errors));

            ValidatorReference v3 = new ValidatorReference("false");
            v3.ObjectFactory = factory;
            v3.Name = "cv2";
            v3.Context = Expression.Parse("DOB");

            Assert.IsTrue(v3.Validate(null, errors));
        }
开发者ID:Binodesk,项目名称:spring-net,代码行数:35,代码来源:ValidatorReferenceTests.cs


示例4: CreateDrawing

        public void CreateDrawing(Inventor.Application ThisApplication)
        {
            DrawingDocument drawingDoc;
            drawingDoc = (DrawingDocument)ThisApplication.ActiveDocument;

            Sheet sheet;
            sheet = drawingDoc.Sheets[1];

            Point2d point1;
            point1 = ThisApplication.TransientGeometry.CreatePoint2d(5, 5);

            _Document partDoc;
            partDoc = ThisApplication.Documents.Open("c:\\testpart.ipt", false);

            DrawingView view1;
            view1 = sheet.DrawingViews.AddBaseView(partDoc, point1, 1, ViewOrientationTypeEnum.kBottomViewOrientation, DrawingViewStyleEnum.kHiddenLineDrawingViewStyle, "", null, null);

            partDoc.Close(true);

            Point2d point2;
            point2 = ThisApplication.TransientGeometry.CreatePoint2d(15, 40);

            DrawingSketch drawingSketch;
            drawingSketch = sheet.Sketches.Add();

            drawingSketch.Edit();
            SketchLine sketchLine;
            sketchLine = drawingSketch.SketchLines.AddByTwoPoints(point1, point2);
            drawingSketch.ExitEdit();

            SectionDrawingView view2;
            view2 = sheet.DrawingViews.AddSectionView(view1, drawingSketch, point2, DrawingViewStyleEnum.kHiddenLineDrawingViewStyle,
                1, true, "", false, true, null);
            drawingSketch.Visible = false;
        }
开发者ID:guchanghai,项目名称:Cut,代码行数:35,代码来源:myDrawing.cs


示例5: ChangeBalloons

        public void ChangeBalloons(Inventor.Application ThisApplication)
        {
            DrawingDocument drawDoc;
            drawDoc = (DrawingDocument)ThisApplication.ActiveDocument;

            Sheet sheet;
            sheet = drawDoc.ActiveSheet;

            long balloonCount;
            balloonCount = 1;

            foreach(Balloon balloon in sheet.Balloons)
            {
                balloon.SetBalloonType(BalloonTypeEnum.kHexagonBalloonType, null);
                balloon.PlacementDirection = BalloonDirectionEnum.kBottomDirection;

                long valueSetCount;
                valueSetCount = 1;

                foreach(BalloonValueSet balloonValueSet in balloon.BalloonValueSets)
                {
                    balloonValueSet.OverrideValue = string.Format("Balloon {0} : ValueSet {1}", balloonCount, valueSetCount);
                    valueSetCount = valueSetCount + 1;
                }
                balloonCount = balloonCount + 1;
            }
        }
开发者ID:guchanghai,项目名称:Cut,代码行数:27,代码来源:myBalloon.cs


示例6: WithoutTypeConversion

        public void WithoutTypeConversion()
        {
            Hashtable source = new Hashtable();
            Inventor target = new Inventor();

            source["name"] = "Nikola Tesla";
            source["dob"] = new DateTime(1856, 7, 9);

            // I know this is pupin's graduation year but I need a date here
            source["dateofgraduation"] = new DateTime(1883,1,1);
            source["inventions"] = new string[] {"One", "Two"};

            mgr.BindSourceToTarget(source, target, null);

            Assert.IsTrue(mgr.HasBindings);
            Assert.AreEqual("Nikola Tesla", target.Name);
            Assert.AreEqual(new DateTime(1856, 7, 9), target.DOB);
            Assert.AreEqual(new string[] {"One", "Two"}, target.Inventions);
            Assert.IsNull(target.PlaceOfBirth.City);
            Assert.IsNull(target.PlaceOfBirth.Country);

            target.Name = "Tesla, Nikola";
            target.DOB = DateTime.Today;
            target.PlaceOfBirth.City = "Smiljan";
            target.PlaceOfBirth.Country = "Lika";

            mgr.BindTargetToSource(source, target, null);
            Assert.AreEqual("Tesla, Nikola", source["name"]);
            Assert.AreEqual(DateTime.Today, source["dob"]);
            Assert.AreEqual("One", ((string[]) source["inventions"])[0]);
            Assert.AreEqual("Smiljan", source["cityOfBirth"]);
            Assert.AreEqual("Lika", source["countryOfBirth"]);
        }
开发者ID:ouyangyl,项目名称:MySpringNet,代码行数:33,代码来源:BaseBindingManagerTests.cs


示例7: ShowSurfaceArea

        public void ShowSurfaceArea(Inventor.Application ThisApplication)
        {
            //���õ������ĵ���ѡ� 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Inventory类代码示例发布时间:2022-05-24
下一篇:
C# InvalidOperationException类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap