|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
'NXOPEN创建方块体的方法0 y0 P7 c3 _/ U4 m: o, O: g
Dim block1 As Features.BlockFeatureBuilder' z% H: F! ]( G* U; v! l e5 b1 x
Dim point1 As Double = 6
3 l6 q( r- _5 @! R" y { block1 = workpart.Features.CreateBlockFeatureBuilder(Nothing)
$ W" T& Q' v7 X6 ^/ G, a( b! N block1.SetOriginAndLengths(New Point3d(-6, point1, 0), "12", "12", "6")+ V/ b% w# N) l0 @
Dim feature1 As Features.Feature
8 X; Q; l: h2 u" l( ?/ p7 i feature1 = block1.CommitFeature()
' ^& n3 S8 {7 c% G6 O% v/ E( }: r* ~+ ]$ n- Q; p2 m
, r) k5 O7 b4 D" k$ s x$ C! {4 u
'以下是移动体- [9 w! U! l) V9 U) r
Dim block2 As Features.MoveObjectBuilder, O' c4 ~8 Y9 w: A4 P$ v) k; W
block2 = workpart.BaseFeatures.CreateMoveObjectBuilder(Nothing)
) e% Q2 }; c9 Q. [' a6 v9 G+ M
4 D5 [5 j: h5 t block2.TransformMotion.Option = GeometricUtilities.ModlMotion.Options.Distance
! b2 }# _) G9 s' A9 {# R block2.TransformMotion.DistanceValue.RightHandSide = "50" '移动距离
8 W1 _7 c, F; g/ |- ~" u block2.MoveObjectResult = Features.MoveObjectBuilder.MoveObjectResultOptions.CopyOriginal: z y5 ~* t4 u# C( ]# ?- v
4 D4 M9 j+ P! z+ E4 A V
block2.ObjectToMoveObject = Add(block1) '要移动的体. a& L: f3 j$ W" s0 \8 B$ z* T) k ~
+ d! j1 \* a- G' z' L Dim origin1 As Point3d = New Point3d(0.0, 0.0, 0.0)6 _/ A+ R3 K& B+ R2 Y0 ~' K- a7 O
Dim vector1 As Vector3d = New Vector3d(0.0, 1.0, 0.0)
+ ]" k [' ?& H- p- c' s3 ]0 L Dim direction1 As Direction
+ v; G, h+ b( I2 X direction1 = workpart.Directions.CreateDirection(origin1, vector1, SmartObject.UpdateOption.WithinModeling)8 L+ c" J1 U/ r8 c# m; ?2 k! h" a
block2.TransformMotion.DistanceVector = direction1 '移动方向% O0 n) k: i. v1 e& J3 `( ]
" u+ u/ K/ Y: H
block2.NumberOfCopies = "3" '移动数量- }3 a, G f s5 Z9 r1 C
1 P, t7 u) m/ X+ }1 P Dim nXObject1 As NXObject
* H3 f, `+ V8 D) e+ j1 r' Y nXObject1 = block2.Commit()- D) @; H+ U, x% Z$ L
0 o" D) @- g7 H6 \* c ^! }
上面红色那段代码怎么改写。请指教。(这是用JA录制的VB代码)
0 Z8 N0 |# e! _ e2 _- @2 _# R# q8 ^; M( F" K8 q% n0 S
|
|