|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
'NXOPEN创建方块体的方法
. J( Q! ?$ t4 ~3 V' s9 O+ T' U; L8 x Dim block1 As Features.BlockFeatureBuilder
4 |/ q/ @; `2 Q1 Y; |! V: d Dim point1 As Double = 6
, Z+ G$ L; o0 v$ W/ ~& h7 d9 s% r block1 = workpart.Features.CreateBlockFeatureBuilder(Nothing), n+ C$ ^; ]8 B% j
block1.SetOriginAndLengths(New Point3d(-6, point1, 0), "12", "12", "6")% u, r' Q5 w: g+ G: q
Dim feature1 As Features.Feature7 S1 I( ~0 t5 z
feature1 = block1.CommitFeature()& ]" I1 D: p, K' I8 c8 |$ d' ]
h6 j( D% \' n! x/ q) \1 D" U1 J. R" q# e7 P4 c- @3 P. J5 Y* c
'以下是移动体$ Y7 m( y2 D6 q$ B5 z
Dim block2 As Features.MoveObjectBuilder
- G* H. ~4 }3 z( x$ K3 n9 w! g block2 = workpart.BaseFeatures.CreateMoveObjectBuilder(Nothing)% L3 H/ T* |, m! A% W
. G7 J4 p( F, \' }* u( T+ z block2.TransformMotion.Option = GeometricUtilities.ModlMotion.Options.Distance
5 J( P. K T: z; @ block2.TransformMotion.DistanceValue.RightHandSide = "50" '移动距离' _& z, V* ~4 K( k. ]; d
block2.MoveObjectResult = Features.MoveObjectBuilder.MoveObjectResultOptions.CopyOriginal
4 S$ I8 Q7 R& r" m) E% p: N: j$ p& S3 P
block2.ObjectToMoveObject = Add(block1) '要移动的体3 d" m0 q. P l8 X9 I3 K( R$ D* p7 s! |
5 r! g0 {8 v9 H" A
Dim origin1 As Point3d = New Point3d(0.0, 0.0, 0.0)0 ^. s, d0 r4 u! m8 i
Dim vector1 As Vector3d = New Vector3d(0.0, 1.0, 0.0)" R0 v3 I- Y3 h8 m0 s- L ~+ ]
Dim direction1 As Direction
! |+ q/ I; Q7 _( p% a% F direction1 = workpart.Directions.CreateDirection(origin1, vector1, SmartObject.UpdateOption.WithinModeling)
. I. ?7 O8 r* g5 j& |# K- u block2.TransformMotion.DistanceVector = direction1 '移动方向
9 }+ V4 D2 f1 v$ s1 c/ m2 Y/ L
# U8 X( u u9 h: N; F block2.NumberOfCopies = "3" '移动数量7 [% ]; `7 g7 P# _9 W
, s9 B: T3 ~4 ?+ M7 N5 Z
Dim nXObject1 As NXObject+ h- y( b- `7 [/ q9 O4 p
nXObject1 = block2.Commit()
( V& p/ L, K- G! i( D+ M- ]& N+ O9 V6 R
上面红色那段代码怎么改写。请指教。(这是用JA录制的VB代码)! e0 I. k' m. f3 R( g
7 S9 H- J5 @. T* ~2 n5 s
|
|