|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
'NXOPEN创建方块体的方法
# `6 I" _: g9 z( n Dim block1 As Features.BlockFeatureBuilder2 r! ]0 p. X! \6 H
Dim point1 As Double = 6
/ m) j/ M8 N* I" S: g block1 = workpart.Features.CreateBlockFeatureBuilder(Nothing)" Q3 g1 w# e& p4 t- J
block1.SetOriginAndLengths(New Point3d(-6, point1, 0), "12", "12", "6")
* V* p: R+ ]/ ?5 u Dim feature1 As Features.Feature* `1 A$ q! H/ R1 A6 h( ~
feature1 = block1.CommitFeature()5 p4 a, y2 c8 C, r( ^* J* T
# S) Y0 c3 N4 i6 \
; \: Y+ t) _: Q# e: C '以下是移动体* ~! D5 l9 i$ | x6 e! G$ C. O
Dim block2 As Features.MoveObjectBuilder
) i! U0 t, g0 c3 c( a8 g% x6 f block2 = workpart.BaseFeatures.CreateMoveObjectBuilder(Nothing)* o2 d+ A( X `0 K: _
7 f, x' m. @8 J2 @
block2.TransformMotion.Option = GeometricUtilities.ModlMotion.Options.Distance
' c" e. v' M( P, i" e9 b8 d2 x1 G0 @ block2.TransformMotion.DistanceValue.RightHandSide = "50" '移动距离
3 N7 k1 @# ?1 m block2.MoveObjectResult = Features.MoveObjectBuilder.MoveObjectResultOptions.CopyOriginal
8 [+ f+ b# L$ _& q& l4 t$ h9 y# R; N, O9 H ~, r
block2.ObjectToMoveObject = Add(block1) '要移动的体
4 z* C0 |5 K* Q: A
& c% U5 D" \: Y R& d Dim origin1 As Point3d = New Point3d(0.0, 0.0, 0.0)
/ L$ {) [. C, J, Y. y& R Dim vector1 As Vector3d = New Vector3d(0.0, 1.0, 0.0)
0 Z0 L! ~2 U8 w0 n; L9 o Dim direction1 As Direction
4 K8 p6 @9 U9 l% A9 t direction1 = workpart.Directions.CreateDirection(origin1, vector1, SmartObject.UpdateOption.WithinModeling)# ^% w1 r' X. [8 O1 k9 B: C6 W
block2.TransformMotion.DistanceVector = direction1 '移动方向( d; g2 R% R1 X2 d
' a* i2 X E. I2 B: v6 F! Z block2.NumberOfCopies = "3" '移动数量
9 v: ?) l4 J( b1 L0 {# E( _3 k
; v& d7 N. v9 d Dim nXObject1 As NXObject0 y6 Y9 h8 i! |; U5 g
nXObject1 = block2.Commit()0 P6 M$ k# D* b- R
1 S# P; c) k! W* g) M2 z
上面红色那段代码怎么改写。请指教。(这是用JA录制的VB代码)
/ P# H, Y2 v$ u; S4 Q5 b+ ^+ Z/ Z1 [/ i) G/ N1 j- x
|
|