|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
'NXOPEN创建方块体的方法; W T8 L- |6 P3 @& d! U- U+ z4 h: u
Dim block1 As Features.BlockFeatureBuilder8 u9 m P) Q% Q& _9 f" N; p. }3 ?
Dim point1 As Double = 6$ L1 v6 [% c- M v' J V9 e% g
block1 = workpart.Features.CreateBlockFeatureBuilder(Nothing). x0 _) _3 M4 c( O
block1.SetOriginAndLengths(New Point3d(-6, point1, 0), "12", "12", "6")2 e O: z8 d) `4 w0 i1 l
Dim feature1 As Features.Feature3 m/ F1 C0 F& S2 d$ q
feature1 = block1.CommitFeature()' j+ r. g* l% r5 G
; C0 K) h, Y2 `: F/ A& q& @" K& L& H; Y+ `
'以下是移动体: k4 ]- t/ j) B! K
Dim block2 As Features.MoveObjectBuilder* k" b8 j" J z6 C4 c& f
block2 = workpart.BaseFeatures.CreateMoveObjectBuilder(Nothing)$ K1 r/ @$ g3 W1 Y
$ f6 b% Y$ F) ]) J6 a& G block2.TransformMotion.Option = GeometricUtilities.ModlMotion.Options.Distance
/ B$ V! m- ~+ Q: K block2.TransformMotion.DistanceValue.RightHandSide = "50" '移动距离
* P- h8 ^ ]; O- @, o: w9 [ block2.MoveObjectResult = Features.MoveObjectBuilder.MoveObjectResultOptions.CopyOriginal+ x* }" B, {6 s6 b8 Q* f
3 {+ ?, V- u6 ^ block2.ObjectToMoveObject = Add(block1) '要移动的体
1 ]: i; g5 o% V4 r# {+ `! N, j1 i0 G+ p# u" h: y# d
Dim origin1 As Point3d = New Point3d(0.0, 0.0, 0.0)& f! z4 R2 ]8 ]# ?7 L; |$ d
Dim vector1 As Vector3d = New Vector3d(0.0, 1.0, 0.0)
7 h7 W0 c) X1 w3 ~/ C1 ^2 S Dim direction1 As Direction
7 y7 o3 B }- q1 R$ [1 R direction1 = workpart.Directions.CreateDirection(origin1, vector1, SmartObject.UpdateOption.WithinModeling)
, ~4 A5 y1 R( M* c5 d4 t' j8 c6 S block2.TransformMotion.DistanceVector = direction1 '移动方向# q. }7 Q; P# Q
% J' H( d* Z r7 H' D block2.NumberOfCopies = "3" '移动数量( Y3 V8 s& M# E! h
' }; Q. B1 C5 N/ U5 A3 A
Dim nXObject1 As NXObject
) {: m) Y9 r; A' j& j( r nXObject1 = block2.Commit()
v: y2 \0 g" z) k$ m( `) b1 g8 G; q
, P" t! V9 c% b$ j7 E/ |上面红色那段代码怎么改写。请指教。(这是用JA录制的VB代码)* ?/ R& n* O+ t* Y! O
% s( O& M. ~! `& J' e S |
|