|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
'NXOPEN创建方块体的方法
/ u3 ?& ~$ I' K$ |" B) D Dim block1 As Features.BlockFeatureBuilder' Y" l9 B- w" [0 [$ h! V& p
Dim point1 As Double = 6+ Z0 G1 W$ m" N/ N
block1 = workpart.Features.CreateBlockFeatureBuilder(Nothing)
' t7 F! w1 ~' Q6 c% r block1.SetOriginAndLengths(New Point3d(-6, point1, 0), "12", "12", "6")7 `& v% H7 }5 h: t a' H$ i. V, K5 B
Dim feature1 As Features.Feature
H) r3 {% G% k' J# s t5 B feature1 = block1.CommitFeature()
5 }* @" y$ i5 n* ~6 Y4 Z: b6 u3 e# M# ^1 B+ r/ q- g/ X8 I
& a: H2 G" t1 C7 X1 d
'以下是移动体
- e) W5 ^# A8 m V9 Z# H) X Dim block2 As Features.MoveObjectBuilder
- u8 G: c2 z5 _ block2 = workpart.BaseFeatures.CreateMoveObjectBuilder(Nothing)% i& x2 B" N& p; ], J0 l% |0 `
# m- {% }0 M6 U& O3 M5 b; Z, I# @ block2.TransformMotion.Option = GeometricUtilities.ModlMotion.Options.Distance) l0 P) j- {7 g b$ }
block2.TransformMotion.DistanceValue.RightHandSide = "50" '移动距离
X9 m9 _3 Q" G- N block2.MoveObjectResult = Features.MoveObjectBuilder.MoveObjectResultOptions.CopyOriginal
$ w6 A d% z+ y2 F8 _+ h, i
1 b. a8 `( A- B( b( J5 ?. t# v) a( d block2.ObjectToMoveObject = Add(block1) '要移动的体
) N& ~# F8 J1 a# Q" V6 V: k- G$ T- M! E2 M$ d4 j
Dim origin1 As Point3d = New Point3d(0.0, 0.0, 0.0)1 o6 G5 V5 r# H4 z
Dim vector1 As Vector3d = New Vector3d(0.0, 1.0, 0.0)
/ ^" L/ n" h5 h3 e Dim direction1 As Direction
( t) d6 Z4 V" Y direction1 = workpart.Directions.CreateDirection(origin1, vector1, SmartObject.UpdateOption.WithinModeling)( c4 I. C7 U+ G7 C: k+ v
block2.TransformMotion.DistanceVector = direction1 '移动方向
) f, h7 A6 C- ^ h- s
1 Y4 ^9 r3 \7 i$ k( S9 _( ? block2.NumberOfCopies = "3" '移动数量
" |/ N1 \) b% D& z F3 g* V! r8 A
Dim nXObject1 As NXObject- W* F1 t2 E7 Q% X: ]+ I- `2 i
nXObject1 = block2.Commit()3 O2 y4 `' @) O7 X* S6 g* S1 M; A
' p. x$ c: ?( B7 W# n: r- Y
上面红色那段代码怎么改写。请指教。(这是用JA录制的VB代码)5 o: {: B) i3 j: c/ H
( a- s8 u- k$ D m
|
|