|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
'NXOPEN创建方块体的方法
; T5 D# b2 p8 S' [) k& V8 n: n Dim block1 As Features.BlockFeatureBuilder, u7 u* V* q" `, j
Dim point1 As Double = 6
8 {* [/ D, [( X1 O1 e block1 = workpart.Features.CreateBlockFeatureBuilder(Nothing)
, O, Q" u. }! r! B block1.SetOriginAndLengths(New Point3d(-6, point1, 0), "12", "12", "6")) \2 I5 d4 `8 t) C
Dim feature1 As Features.Feature( I1 {: @" c6 f4 Y/ }+ F: t' v6 G
feature1 = block1.CommitFeature()
/ P- r! C8 m+ Y" ~/ L: y5 i1 d9 q4 f5 |
- k G; i- \2 D: X, S: Q) A '以下是移动体
, w1 d( |6 B/ N0 h8 g Dim block2 As Features.MoveObjectBuilder7 H. o" c9 g% T# _
block2 = workpart.BaseFeatures.CreateMoveObjectBuilder(Nothing)+ K. j' G' n) n5 S: q7 c! C0 f
0 W9 d( H3 g9 f7 s" O& t: T$ H block2.TransformMotion.Option = GeometricUtilities.ModlMotion.Options.Distance/ I7 |1 e P8 A8 [, ?
block2.TransformMotion.DistanceValue.RightHandSide = "50" '移动距离9 z3 e3 {2 W! ]! ~3 N
block2.MoveObjectResult = Features.MoveObjectBuilder.MoveObjectResultOptions.CopyOriginal! Q& Y' ^7 [9 P
$ h- k) }' r( Z! y8 k
block2.ObjectToMoveObject = Add(block1) '要移动的体* i. _* L9 z# ?, c1 I
/ \: o" c; j( O- Z; B2 z3 B& r Dim origin1 As Point3d = New Point3d(0.0, 0.0, 0.0)/ s, R+ Q) T& O4 F# O
Dim vector1 As Vector3d = New Vector3d(0.0, 1.0, 0.0)5 e) r3 F) P: l" F; c6 ^; b
Dim direction1 As Direction) x! u% E; c. G2 N, `; U2 m! ]) }
direction1 = workpart.Directions.CreateDirection(origin1, vector1, SmartObject.UpdateOption.WithinModeling)
- H. X& y+ E7 d/ | block2.TransformMotion.DistanceVector = direction1 '移动方向
7 i# y! V$ `5 x
. A; e7 S) [* s9 U5 W- A/ L block2.NumberOfCopies = "3" '移动数量
9 t/ C; M- E+ b+ E- [2 W
7 {) _( Y& E* e+ {6 @( d; I Dim nXObject1 As NXObject7 d+ f. o7 Y* z% a0 a: d! S4 |1 }% i0 u
nXObject1 = block2.Commit()
2 `% w6 K& p$ j+ A* O+ @5 Y
! \5 K, A/ f; j; c0 h" U# r' q上面红色那段代码怎么改写。请指教。(这是用JA录制的VB代码)
3 `/ \7 o' j/ g& b$ Y$ |0 K( g
4 x- h5 @, W+ I. p |
|