|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
'NXOPEN创建方块体的方法; p2 m* A% m8 C3 D4 g
Dim block1 As Features.BlockFeatureBuilder- z2 ]; V# S5 [. S/ h
Dim point1 As Double = 6
' F) G9 m4 N8 p block1 = workpart.Features.CreateBlockFeatureBuilder(Nothing) W( G$ C; \7 U+ R7 D- k
block1.SetOriginAndLengths(New Point3d(-6, point1, 0), "12", "12", "6")
6 J& G! C7 {$ r* L* n0 Y Dim feature1 As Features.Feature
% L7 U- |* a6 Y0 x# w2 c" `3 v' s feature1 = block1.CommitFeature()$ P7 T, `! A* J* k1 r9 J
5 C( A+ d! b. } j0 `8 j/ [
2 b, y# T: h3 t8 m '以下是移动体
, q, d/ ^+ H! V L( c8 K; p) D7 a Dim block2 As Features.MoveObjectBuilder0 }7 |* e4 t8 K0 ]* t) Y. x
block2 = workpart.BaseFeatures.CreateMoveObjectBuilder(Nothing). n& E3 g* C9 q- Y N C; ~
- ^: V0 ^" p* h. e! R; x; Z
block2.TransformMotion.Option = GeometricUtilities.ModlMotion.Options.Distance
9 Y7 p- g2 F4 e block2.TransformMotion.DistanceValue.RightHandSide = "50" '移动距离# I: X# V/ ^+ @, J& b
block2.MoveObjectResult = Features.MoveObjectBuilder.MoveObjectResultOptions.CopyOriginal- n% G2 I' `! b( j1 M6 D, T
& |, z0 o7 y' f3 L# `0 U; f* e" B& L block2.ObjectToMoveObject = Add(block1) '要移动的体
- H- C7 \5 _; H; H1 s& N0 N) ~0 ^3 s9 g
5 y, Y/ V9 ?" S3 N4 b1 @ Dim origin1 As Point3d = New Point3d(0.0, 0.0, 0.0)
- N5 w. R" C4 e# ] Dim vector1 As Vector3d = New Vector3d(0.0, 1.0, 0.0)# C, a! r& b: i ?* G6 E
Dim direction1 As Direction
% k- D* D' R! Y8 B! h& p direction1 = workpart.Directions.CreateDirection(origin1, vector1, SmartObject.UpdateOption.WithinModeling)4 x* A: L! ~1 o% `- S! {8 Z! a
block2.TransformMotion.DistanceVector = direction1 '移动方向& L6 I2 s! c7 i0 [' `6 g8 E
: ~5 W: Q4 g* Y$ N' Q+ ` block2.NumberOfCopies = "3" '移动数量
# F, ?: ]* q1 |5 M5 `( M" \! \. E6 h
Dim nXObject1 As NXObject
# p/ \. U; L2 W$ @7 Y( H nXObject1 = block2.Commit()
4 e% `$ X" X8 q3 o, p9 w6 s- c# R: c
上面红色那段代码怎么改写。请指教。(这是用JA录制的VB代码)
. S2 j& b9 N2 c o3 v2 H: o7 P
& R: g2 P" o. k- y; S |
|