PLM之家精品课程培训

PLM之家精品课程培训

联系电话:18301858168   |   QQ咨询:939801026
NX二次开发培训

NX二次开发培训

UFUN/NXOpen C++和实战案例

适合初级入门或想深入了解二次开发的工程师,本培训结合ufun,NXOpen C++,大量的实例及官方内部的开发技术。
公众号二维码

关注公众号

点击扫描二维码免费在线高清教程

课程详情
Catia二次开发培训

Catia二次开发培训

市场需求大,掌握核心技术前景广阔

Catia二次开发的市场需求大,人才稀缺。掌握开发技能潜力巨大,随着经验积累将在汽车、航空等领域有所作为。
B站二维码

在线原创B站视频

点击关注工业软件传道士主页

课程详情
Teamcenter培训

Teamcenter培训

全方位培训,从基础应用到高级开发全覆盖

涵盖用户应用基础培训、管理员基础培训、管理员高级培训及二次开发培训等全方位内容,由多年经验讲师打造。
QQ群二维码

加入同行交流

点击扫描二维码加入QQ群

课程详情
×

PLM之家plmhome公众号

课程涵盖: PLM之家所有原创视频

×

关注B站视频

所有高清视频一览无余,全部在线播放学习

×

加入PLM之家QQ群

同行交流,疑问解答,更多互助

PLM之家PLMHome-国产软件践行者

[二次开发源码] NX二次开发源码分享: 创建精确外轮廓

[复制链接]

2019-1-17 10:56:35 1951 0

admin 发表于 2019-1-17 10:56:35 |阅读模式

admin 楼主

2019-1-17 10:56:35

请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!

您需要 登录 才可以下载或查看,没有账号?注册

x
NX二次开发源码分享: 创建精确外轮廓7 n4 N1 H  L! H8 B4 @
9 H0 e  h+ U9 {7 j5 _3 |
UF_CURVE_create_shadow_outline (view source)  E2 r0 D8 y- ?6 n

1 Y2 `: ]4 ^3 ADefined in: uf_curve.h
, W/ d3 n8 \6 _( X
' Z7 Q6 N6 c0 C, l" [
& ^7 ]# `  S7 w4 B' T& U  {& |Overview9 F. Y: t- \  c) q/ T; ~

, v+ O$ {% \6 uCreate shadow outline for a given array of solids. Solids passed to this
! r5 _- k, }) p% X& Xroutine must be on a selectable layer and visible. If created shadow curves * h; w8 h( Y- Q- L: ?$ y
can not form loops, please use UF_CURVE_create_shadow_curves instead to get
$ Z: C2 Z$ D/ B1 e; w6 t! P5 rshadow curves.
, _. u1 I  M' l7 u: k! _9 m1 a$ e+ f, h
3 Z8 e1 @, C8 b4 h- b- p
[hide]" l( J+ p! @* q
9 j+ J3 ~' ~& F7 a+ K9 r/ Z! e
[mw_shl_code=csharp,true] void DoIt()
* ~' g$ ?/ ~+ J3 k/ i/ Z    {
& H4 N6 ]( L/ J4 X/ n6 m3 a# ]        if (theSession.Parts.Display != theSession.Parts.Work)
0 n: D+ U2 ^# H- s6 t* D            theSession.Parts.SetWork(theSession.Parts.Display);
8 Q' X! c" ~7 G" G! e+ g6 i( B- c( g

2 r1 P8 V& z1 \        TaggedObject[] theBodies = null;
9 I' w" Y. p: H8 P: A" E' I        if (SelectBodies("Select Bodies", ref theBodies) == Selection.Response.Ok)
; o& b4 d" B: b. A# |& }, G        {; u4 L- t8 ]* \) F3 X% R
            Echo("Selected Bodies: " + theBodies.Length.ToString());0 b/ Z( G* ^5 @( ]
            Tag[] theBodyTags = new Tag[theBodies.Length];
; g8 e! A. b2 d" U0 {            for (int ii = 0; ii < theBodies.Length; ii++)
( R( b: y; l" a3 s$ A! y+ p                theBodyTags[ii] = theBodies[ii].Tag;$ P3 f; B, t! b$ y$ o) H

. n8 {0 b. n; V6 n            List<Curve> theOutlineCurves = new List<Curve>();
% e* [$ i; u4 [& g5 P) d4 v# a            ModelingView workView = theSession.Parts.Work.ModelingViews.WorkView;
; y) `) R( }: F% d9 ?, o" |            int loop_count;  ^' N, `7 X+ [
            int[] count_array;: k9 O( O0 p- `* q
            Tag[][] curve_array = null;  t8 Z; d0 Y; j, X1 c$ c5 u
            double[] tol = new double[2];
4 }. z& s2 R3 A7 i  g( d# ?# y) {) E" M, N' J" [
            theUFSession.Modl.AskDistanceTolerance(out tol[0]);
3 B0 @- G; \5 M            theUFSession.Modl.AskAngleTolerance(out tol[1]);4 O, |: ~# f1 T$ D  P5 E1 O
1 c7 k$ u2 d+ c
            theUFSession.Curve.CreatePreciseOutline(theBodyTags.Length, theBodyTags,% k  S( h$ {3 X
                workView.Tag, out loop_count, out count_array, out curve_array, tol);) n( w2 g5 P& p, i: A
& \% z) R$ ~7 {  K# i3 u
            Echo("Precise Outline Loops: " + loop_count.ToString());
3 m( O! Z) D% z* h% D1 \            for (int ii = 0; ii < loop_count; ii++)' k  U! v) K# Y: `9 l
                for (int jj = 0; jj < count_array[ii]; jj++)& L+ _1 b3 m4 l% |& K' w% t
                    theOutlineCurves.Add((Curve)NXOpen.Utilities.NXObjectManager.Get(curve_array[ii][jj]));
: I$ i) u) H$ K( m3 L' q! j            Echo("Precise Outline Curves: " + theOutlineCurves.Count.ToString());& s" r2 j7 i7 f5 j" I7 \- s% G! G
1 J( `1 ?& h/ [) L9 @
            /* If created outline curves can not form loops, use UF_CURVE_create_precise_outline_curves instead
( l8 `7 S. c1 G+ r) k# y            int curve_count;. _. f% L3 a/ h
            Tag[] outline_curves = null;; T! {# a  d' I: n9 k
            theUFSession.Curve.CreatePreciseOutlineCurves(theBodyTags.Length, theBodyTags, $ M2 R% E5 T! v# I. g
                workView.Tag, out curve_count, out outline_curves);
, O) {0 j# a  y            Echo("Precise Outline Curves: " + curve_count.ToString());
. w6 D+ m& R! b) Z            */
* T# w4 _6 u7 s: }! ~$ k        }
5 V( A* F6 D& V. A: }
9 |& l) c* ^# c( }- ]& S2 I1 w    }[/mw_shl_code]+ w) H. |. K8 B6 e7 Z2 R
[/hide]6 A. |# ^: O! `0 W1 \2 {& W: P
上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 www.diantuankj.com/ doTeam.tech
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 注册

返回列表 本版积分规则

  • 发布新帖

  • 在线客服

  • 微信

  • 客户端

  • 返回顶部

  • x
    温馨提示

    本网站(plmhome.com)为PLM之家工业软件学习官网站

    展示的视频材料全部免费,需要高清和特殊技术支持请联系 QQ: 939801026

    PLM之家NX CAM二次开发专题模块培训报名开始啦

    我知道了