找回密码
 立即注册

QQ登录

只需一步,快速开始

微信扫码登录

搜索
查看: 2386|回复: 1

[求助] 草图偏置曲线返回的OBJECT无法用日志拉升

[复制链接]

3

主题

0

回帖

36

积分

列兵

积分
36
发表于 2014-2-21 23:25:09 | 显示全部楼层 |阅读模式
这是录的日志里草图偏置曲线里的
NXObject nXObject2;
    nXObject2 = sketchOffsetBuilder1.Commit();
   
    NXObject[] objects1;
    objects1 = sketchOffsetBuilder1.GetCommittedObjects();
我返回了nXObject2;
并录制了一个草图拉伸的日志 里面这么写的
NXOpen.Features.Feature[] features1 = new NXOpen.Features.Feature[1];
    NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)workPart.Features.FindObject("SKETCH(16)");
    features1[0] = sketchFeature1;
    Sketch sketch1 =(Sketch)workPart.Sketches.FindObject("SKETCH_00SKETCH_000");
    Line line1 = (Line)sketch1.FindObject("Curve Line4");
    Curve nullCurve = null;
    CurveFeatureChainRule curveFeatureChainRule1;
    curveFeatureChainRule1 = workPart.ScRuleFactory.CreateRuleCurveFeatureChain(features1, line1, nullCurve, false, 0.00095);
   
    section1.AllowSelfIntersection(true);
   
    SelectionIntentRule[] rules1 = new SelectionIntentRule[1];
    rules1[0] = curveFeatureChainRule1;
    NXObject nullNXObject = null;
    Point3d helpPoint1 = new Point3d(-18.8530653857088, 21.736029640554, 0.0);
    section1.AddToSection(rules1, line1, nullNXObject, nullNXObject, helpPoint1, NXOpen.Section.Mode.Create, false);
我把NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)workPart.Features.FindObject("SKETCH(16)");
改成了NXOpen.Features.SketchFeature sketchFeature1 = (NXOpen.Features.SketchFeature)nXObject2;
它报错说无法将 NXOpen.sketchoffset强制转换成NXOpen.features.sketchfeature;

再录一段没有草图的拉伸
NXOpen.Features.Feature[] features1 = new NXOpen.Features.Feature[1];
    NXOpen.Features.OffsetCurve offsetCurve1 = (NXOpen.Features.OffsetCurve)nXObject2;//在这写了nXObject2
    features1[0] = offsetCurve1;
    workPart.Features.SuppressFeatures(features1);
它报错说无法将 NXOpen.sketchoffset强制转换成NXOpen.Features.OffsetCurve;

求高手告诉我下怎么转换

3

主题

2

回帖

52

积分

上等兵

积分
52
发表于 2014-2-25 23:27:56 | 显示全部楼层
    刚学习二次开发,问下楼主,如何建立一个新的草图,并在草图中画直线或圆等,然后对草图进行拉伸或旋转等草图。
     现在学习只知道如何再建模环境下建立直线,不太明白在草图环境下一系列的操作如何进行,求指导!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

咨询QQ:1359218528|发帖须知!|Archiver|手机版|小黑屋|UG爱好者论坛 ( 京ICP备10217105号-2 )

GMT+8, 2024-12-22 18:37

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表