|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
'NXOPEN创建方块体的方法
* j% p' t% Q7 m9 t* ~ Dim block1 As Features.BlockFeatureBuilder' W: X0 I7 S/ |" l! U% P; G" O
Dim point1 As Double = 6$ }- m# ?% ]- D$ Y4 J
block1 = workpart.Features.CreateBlockFeatureBuilder(Nothing)
O3 ~4 E( P) ^: _) V( a8 ? block1.SetOriginAndLengths(New Point3d(-6, point1, 0), "12", "12", "6"). x/ [8 o- i; O) k
Dim feature1 As Features.Feature8 m4 S/ p, B& [& Y; j! m( h: n, I( @ H
feature1 = block1.CommitFeature()
$ c" {0 G& a9 v5 G3 B: Z! B( x" m
7 g D! V4 M% V9 A8 T
'以下是移动体
/ c, `, `6 A; o Dim block2 As Features.MoveObjectBuilder
& l$ \# R1 P" Y block2 = workpart.BaseFeatures.CreateMoveObjectBuilder(Nothing)/ q: t* ~! n+ _6 b& {
+ i# d! y$ q5 H) P4 c! \6 q block2.TransformMotion.Option = GeometricUtilities.ModlMotion.Options.Distance
5 W( l( p5 {* @" _% c8 h block2.TransformMotion.DistanceValue.RightHandSide = "50" '移动距离+ c& Y' ` O. s; G: ~5 v
block2.MoveObjectResult = Features.MoveObjectBuilder.MoveObjectResultOptions.CopyOriginal7 z$ Y' D+ u. M+ V4 V
) h: o5 e9 z6 Z* A
block2.ObjectToMoveObject = Add(block1) '要移动的体* ?( |7 o- S, R4 A' p, J* B
' W& A9 k1 X1 P0 Y$ B Dim origin1 As Point3d = New Point3d(0.0, 0.0, 0.0)
* S+ M2 }; q0 h: d2 _ Dim vector1 As Vector3d = New Vector3d(0.0, 1.0, 0.0)6 s* s; L4 ?% c5 o' o
Dim direction1 As Direction0 y1 C" V8 C. H% L/ H# Y
direction1 = workpart.Directions.CreateDirection(origin1, vector1, SmartObject.UpdateOption.WithinModeling)) P6 d- c$ \3 W j' X/ A- N- g
block2.TransformMotion.DistanceVector = direction1 '移动方向2 J1 N" ~" o* ?4 B
( Y) Z1 ^* V1 w% o3 u% P
block2.NumberOfCopies = "3" '移动数量
' P7 d7 D |" N4 ]3 P( C" G5 V: Y+ W( E f9 e6 g
Dim nXObject1 As NXObject& ~2 Q' C( |1 A5 _+ s7 [+ w
nXObject1 = block2.Commit()
! U* D3 c: b2 T* @. ^3 I. G. Y# \$ r( o$ y- m$ l! m& Y6 Q
上面红色那段代码怎么改写。请指教。(这是用JA录制的VB代码)8 R8 _/ c" Y$ M! M( |6 g: A
7 ?9 t8 l0 A* [7 x6 q+ \
|
|