|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
'NXOPEN创建方块体的方法% Y0 o4 e# N1 B j. d' K
Dim block1 As Features.BlockFeatureBuilder8 O# u% _7 k! h( _) b( G
Dim point1 As Double = 6
* g# U" K2 h$ N" z6 g block1 = workpart.Features.CreateBlockFeatureBuilder(Nothing)1 y( z+ j, |. b. F4 }6 U' E
block1.SetOriginAndLengths(New Point3d(-6, point1, 0), "12", "12", "6")
+ |/ {0 X6 U0 }. f- |* A Dim feature1 As Features.Feature
. W$ \4 j t( \2 G2 r feature1 = block1.CommitFeature()/ K( p$ ~! l, m# L
- b W; s% Z! w6 j) @- v8 L- F4 h7 |
( C5 G, z7 w- {3 K4 w3 X
'以下是移动体# w7 U1 a9 n4 Q0 A
Dim block2 As Features.MoveObjectBuilder8 y; k8 ^5 r5 F8 z( I. ?( L# _
block2 = workpart.BaseFeatures.CreateMoveObjectBuilder(Nothing)" _8 T6 k3 n% t4 t6 w1 d
5 j6 r7 [* ]$ s6 I& L block2.TransformMotion.Option = GeometricUtilities.ModlMotion.Options.Distance
, F1 b( ?! G# v1 F9 h block2.TransformMotion.DistanceValue.RightHandSide = "50" '移动距离
( n6 F; I* O3 m2 n- ? block2.MoveObjectResult = Features.MoveObjectBuilder.MoveObjectResultOptions.CopyOriginal
; D5 ?- s+ \$ D2 u" {9 c5 W
# M- X# h, [% h block2.ObjectToMoveObject = Add(block1) '要移动的体) c+ k3 @+ @* k( G. Q& i( N6 b
9 `: s1 @' j( S' G Dim origin1 As Point3d = New Point3d(0.0, 0.0, 0.0)
' Y# Y! ?7 b2 w* j, E9 `9 ~- _ Dim vector1 As Vector3d = New Vector3d(0.0, 1.0, 0.0)$ S5 T% F* r& A
Dim direction1 As Direction8 L/ C; `5 L' ^8 f8 H% a
direction1 = workpart.Directions.CreateDirection(origin1, vector1, SmartObject.UpdateOption.WithinModeling)& p3 i3 j$ v/ b8 a4 d+ E y
block2.TransformMotion.DistanceVector = direction1 '移动方向
& y2 V( H2 t. q4 B# g9 ^2 E5 n% A3 `" y( n7 I% y1 |& S4 B
block2.NumberOfCopies = "3" '移动数量
' E5 b* E1 r6 F0 [. o, {; L' g& L z# R: R L( B
Dim nXObject1 As NXObject0 z3 j( E' q8 h* g2 }
nXObject1 = block2.Commit()" q# a/ P5 m' I- T7 |0 O; _ w/ s
: `5 i3 H! M( B6 c
上面红色那段代码怎么改写。请指教。(这是用JA录制的VB代码)
, E2 X1 c* [' r8 p" b8 u2 M* `/ @2 T9 Z
|
|