|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
'NXOPEN创建方块体的方法 i+ L& ?) n% V2 ^& {( M. m# B
Dim block1 As Features.BlockFeatureBuilder: K0 f( N* _& u, l5 r, p
Dim point1 As Double = 6
. i5 q2 p4 O9 M2 j1 W. Q2 d block1 = workpart.Features.CreateBlockFeatureBuilder(Nothing)
0 @! F1 q7 g. v0 b4 v block1.SetOriginAndLengths(New Point3d(-6, point1, 0), "12", "12", "6")
$ m5 b( V* R4 p% [& M Dim feature1 As Features.Feature
; M3 x/ S: x1 y# _; r9 m+ b feature1 = block1.CommitFeature()6 \9 }; k+ F/ h4 |& Z, L8 c! x
1 P% P/ R3 G1 f/ c: F" u# c% n" Q: O3 _+ d3 w
'以下是移动体
' r' u! M" i: H3 i0 ~/ e Dim block2 As Features.MoveObjectBuilder n7 h9 y) \! W. C0 ]
block2 = workpart.BaseFeatures.CreateMoveObjectBuilder(Nothing)
R2 T3 m+ A+ \$ v% K" u& u; P
+ x: q j/ L$ | Q" T F block2.TransformMotion.Option = GeometricUtilities.ModlMotion.Options.Distance" s/ n( f! _! p8 C
block2.TransformMotion.DistanceValue.RightHandSide = "50" '移动距离6 S1 p, P' X, t- l% O- M0 i
block2.MoveObjectResult = Features.MoveObjectBuilder.MoveObjectResultOptions.CopyOriginal" o; k" F! D( P* E, v
. ^' b+ |4 l$ ?! N block2.ObjectToMoveObject = Add(block1) '要移动的体, [: f4 O8 Z }7 K- g
% h5 ?1 l2 j- K" ~5 ? Dim origin1 As Point3d = New Point3d(0.0, 0.0, 0.0)
: y4 Z0 {4 W* ]) b2 E8 |7 ? Dim vector1 As Vector3d = New Vector3d(0.0, 1.0, 0.0)
/ ^$ e8 c2 @1 D$ m) x( ]0 _# B Dim direction1 As Direction
+ x2 b7 V6 S/ }7 C3 }' L( O direction1 = workpart.Directions.CreateDirection(origin1, vector1, SmartObject.UpdateOption.WithinModeling)
+ d! U: Z2 h1 L& H block2.TransformMotion.DistanceVector = direction1 '移动方向
% E6 o. v8 i3 q0 W' T1 a' q, G# m6 j: z2 x( U
block2.NumberOfCopies = "3" '移动数量8 S: T" C N, O6 w% m/ f, l
3 c0 q) A0 J8 Z6 {1 U8 c) s
Dim nXObject1 As NXObject5 @8 o4 ]' q7 F3 G
nXObject1 = block2.Commit()$ E) B9 {; _+ |6 Z! n% H$ F( e5 @* n
9 y2 d. y% Y% t0 X上面红色那段代码怎么改写。请指教。(这是用JA录制的VB代码)8 B( ]7 `/ y2 W. P! R
! @! m2 e* Z) q, U8 L& K. F$ O- x
|
|