|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
'NXOPEN创建方块体的方法% r* D# t5 K% O b
Dim block1 As Features.BlockFeatureBuilder' f" W' m9 A3 A# |8 Y5 C
Dim point1 As Double = 6
" X" |0 _0 K0 f$ \8 Y3 R- _ block1 = workpart.Features.CreateBlockFeatureBuilder(Nothing)7 z! w# w, c4 E0 t
block1.SetOriginAndLengths(New Point3d(-6, point1, 0), "12", "12", "6")
% K" i/ ]- z" q; X6 m Dim feature1 As Features.Feature6 A0 t! M! j8 P, y8 S, J, i
feature1 = block1.CommitFeature()5 F' j. p$ Y. s9 `. Y d$ X
# S) ?$ z- f+ k! S$ J0 ^0 k& L( a
) W$ D* w( o6 @/ |( y4 f
'以下是移动体
. \! G# f! |, b Dim block2 As Features.MoveObjectBuilder
# t! ^: T" V. e" t block2 = workpart.BaseFeatures.CreateMoveObjectBuilder(Nothing), t! ~) Y8 X/ f% l! P( r. j2 @; ]" x
: l+ J5 m8 Y5 @8 Y2 s3 Y block2.TransformMotion.Option = GeometricUtilities.ModlMotion.Options.Distance9 d* y+ Q9 Y' h; F; m: k
block2.TransformMotion.DistanceValue.RightHandSide = "50" '移动距离
7 G3 p0 Z2 y. p; |( J2 u block2.MoveObjectResult = Features.MoveObjectBuilder.MoveObjectResultOptions.CopyOriginal
1 `' w" ]6 f) H G
& E5 i: g9 T8 X' l5 Z block2.ObjectToMoveObject = Add(block1) '要移动的体& O6 p1 t6 x7 A8 [5 @# l& i
5 @7 c+ ]. B% g7 v
Dim origin1 As Point3d = New Point3d(0.0, 0.0, 0.0)/ E1 C1 s( A: M# }/ |1 A; l
Dim vector1 As Vector3d = New Vector3d(0.0, 1.0, 0.0)
, r2 q& P9 {; W: ? Dim direction1 As Direction# z2 d0 F9 z' d) x U
direction1 = workpart.Directions.CreateDirection(origin1, vector1, SmartObject.UpdateOption.WithinModeling)
, W/ b' h4 V' o( s5 H% L block2.TransformMotion.DistanceVector = direction1 '移动方向. O" S. h6 G$ s- W% _2 g j0 `
, L7 t. y% M% D. ~$ E1 q @2 b block2.NumberOfCopies = "3" '移动数量
+ L9 _1 c8 X/ z2 f
! J5 b8 W( p0 w' \ Dim nXObject1 As NXObject
2 Y7 w, Z5 R& Q1 r% Z nXObject1 = block2.Commit()5 ?3 P0 T8 l& X5 B" @. J
' I2 Q8 k* H/ J$ {9 h7 H, \ w; V1 T. T4 b上面红色那段代码怎么改写。请指教。(这是用JA录制的VB代码)5 Q1 q: `0 q1 S2 g. n
$ J) }4 N3 |1 K
|
|