|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
'NXOPEN创建方块体的方法
0 ?! R- E3 }6 ~3 j7 n# w, l# J Dim block1 As Features.BlockFeatureBuilder
+ V" Y9 P8 x9 o Dim point1 As Double = 6: p6 y- T+ r* Y% G% }
block1 = workpart.Features.CreateBlockFeatureBuilder(Nothing)
* y$ G/ }1 K! U& v block1.SetOriginAndLengths(New Point3d(-6, point1, 0), "12", "12", "6")8 Q) i) g4 f; j- m: r; e: q' ~0 Z
Dim feature1 As Features.Feature7 y! D& h2 V# B& }; x5 O
feature1 = block1.CommitFeature()
6 T+ H5 u x: ]% R" B5 n
4 j+ R- e2 o! o l8 m7 Z7 S$ C. K0 A" r1 D% r- b
'以下是移动体4 R( Q1 m! k5 }5 {) m
Dim block2 As Features.MoveObjectBuilder5 [- B: L. T! Z: T1 o, F
block2 = workpart.BaseFeatures.CreateMoveObjectBuilder(Nothing)8 a: M0 ~& S& A! p7 W
6 o( S i( Z' L V+ p- N block2.TransformMotion.Option = GeometricUtilities.ModlMotion.Options.Distance
2 t( m- i- Y* a+ I block2.TransformMotion.DistanceValue.RightHandSide = "50" '移动距离: e: |& E6 Y% ~0 J( W) ~* j
block2.MoveObjectResult = Features.MoveObjectBuilder.MoveObjectResultOptions.CopyOriginal: l- J$ J) H* }: m, k8 h
' |6 F; X' T* ~0 y* U5 P
block2.ObjectToMoveObject = Add(block1) '要移动的体1 \7 g0 }, N# `
" e" v4 P: c* B$ g Dim origin1 As Point3d = New Point3d(0.0, 0.0, 0.0)
4 U0 a7 }7 n- j0 {" V) [ Dim vector1 As Vector3d = New Vector3d(0.0, 1.0, 0.0)" e, ^# C/ t( d: I
Dim direction1 As Direction. V2 F' z* W: g! O1 b# D
direction1 = workpart.Directions.CreateDirection(origin1, vector1, SmartObject.UpdateOption.WithinModeling)& v E. D [) ~) s, m
block2.TransformMotion.DistanceVector = direction1 '移动方向
' A; m9 t. X6 V* B5 Z6 z7 A& S$ ^7 Z9 s- |0 {5 m
block2.NumberOfCopies = "3" '移动数量
& r* u% m+ `, f3 [
' ~1 N$ X% {3 w+ k4 c# B2 u Dim nXObject1 As NXObject! Z+ _" N1 X3 S) O
nXObject1 = block2.Commit()
6 |) |/ {& q9 I( d1 Q+ J' ?) M, H8 i% T5 b. i5 v$ f8 e$ g- o) U
上面红色那段代码怎么改写。请指教。(这是用JA录制的VB代码) j, }9 w) m9 e6 b3 `& x
0 ^8 |$ m# L8 j2 [% \" d I
|
|