|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
'NXOPEN创建方块体的方法+ m! I* g" S8 u1 H# o3 r1 \' a4 T" ?) j
Dim block1 As Features.BlockFeatureBuilder
; u; t) J+ s' F6 M; R( j Dim point1 As Double = 6
" ?% {2 P ^3 n" z: |7 G0 s+ t block1 = workpart.Features.CreateBlockFeatureBuilder(Nothing)
7 ^( ?+ O& m" C5 i' m; Z; N! { block1.SetOriginAndLengths(New Point3d(-6, point1, 0), "12", "12", "6")
- g& {6 Z4 `. e) X0 f Dim feature1 As Features.Feature
O( V1 M, P: s% T/ A3 Z6 P feature1 = block1.CommitFeature()
: e. Q. F4 U4 k0 B. b( d/ g0 _% d# u
A `- Z4 I: p$ {- s
'以下是移动体
" v* U- ~& p: v8 l Dim block2 As Features.MoveObjectBuilder3 [, T- D' p8 g- a' B/ c
block2 = workpart.BaseFeatures.CreateMoveObjectBuilder(Nothing)
# j o1 K5 r! p5 f! Q3 ~3 s5 P6 P. v) y: ^- n9 \+ s) m: @
block2.TransformMotion.Option = GeometricUtilities.ModlMotion.Options.Distance$ }# ]( @; j ]* l; M+ R$ H+ R D$ {
block2.TransformMotion.DistanceValue.RightHandSide = "50" '移动距离' l2 o& }3 t8 Y$ Y2 s2 {- n% ]
block2.MoveObjectResult = Features.MoveObjectBuilder.MoveObjectResultOptions.CopyOriginal
9 h, e) [, n% x$ i! L
% h# L) p* x5 I; a block2.ObjectToMoveObject = Add(block1) '要移动的体1 Y/ k7 E* A2 |$ _
1 _: E* s& m0 H6 g
Dim origin1 As Point3d = New Point3d(0.0, 0.0, 0.0). p! U3 u/ X4 K+ |- P3 c
Dim vector1 As Vector3d = New Vector3d(0.0, 1.0, 0.0)
6 f% p+ F; j- d- S$ ~ Dim direction1 As Direction2 R" p7 W1 H0 _7 I1 z5 C2 P8 g
direction1 = workpart.Directions.CreateDirection(origin1, vector1, SmartObject.UpdateOption.WithinModeling)5 S6 i. z/ F; s, L" a/ M! O# v- w
block2.TransformMotion.DistanceVector = direction1 '移动方向& K7 ~7 p, z& I( m. J
' ~" n w- Z3 }' C block2.NumberOfCopies = "3" '移动数量% [# F+ m! x s8 y& w+ `
9 } w$ h$ f. @' _
Dim nXObject1 As NXObject
& J2 r; S7 ]- D8 C! i, ` w nXObject1 = block2.Commit() D( l+ M a4 w5 I0 c- Y3 O: K% v# r
8 O, P! E/ ~1 \! ^7 l' P上面红色那段代码怎么改写。请指教。(这是用JA录制的VB代码)2 i, v1 f# Q9 }& A: s. o
# K- D5 C) L+ `2 D4 E
|
|