|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
×
'NXOPEN创建方块体的方法
( r7 I& U2 p1 w Dim block1 As Features.BlockFeatureBuilder
2 c! k3 l4 p9 f# b n4 O Dim point1 As Double = 6
1 b% ]% b8 J- w' \, ]+ r* w# B block1 = workpart.Features.CreateBlockFeatureBuilder(Nothing)
% |$ ]) C3 z% u0 S! b9 @ block1.SetOriginAndLengths(New Point3d(-6, point1, 0), "12", "12", "6"); }- w3 r: Q) c. r
Dim feature1 As Features.Feature
) x7 {- {2 Q" [) f$ r feature1 = block1.CommitFeature()- i. q2 a+ @9 f4 J" `3 u
+ J, C" P8 M$ x4 I
7 P; E/ g( W G) w, J9 M7 w
'以下是移动体
8 |9 T2 G% w& P Dim block2 As Features.MoveObjectBuilder
% h+ u( x) q) B( [, _* Q5 v! h: j block2 = workpart.BaseFeatures.CreateMoveObjectBuilder(Nothing)
# s3 J# {2 L# U
+ d4 A7 F7 u: U block2.TransformMotion.Option = GeometricUtilities.ModlMotion.Options.Distance
2 d8 `" {2 g+ @2 L block2.TransformMotion.DistanceValue.RightHandSide = "50" '移动距离$ I: o; J3 `3 [
block2.MoveObjectResult = Features.MoveObjectBuilder.MoveObjectResultOptions.CopyOriginal( h& W( C' z: p' }( s/ M3 z4 s* I
) z* G" T+ t5 \7 M& a4 X: b( U1 Z
block2.ObjectToMoveObject = Add(block1) '要移动的体5 Y# m& ]; i* V/ x/ S
2 l/ |( V& f3 \/ s) ] Dim origin1 As Point3d = New Point3d(0.0, 0.0, 0.0); ]3 b: w7 P, P5 t3 r6 B! D
Dim vector1 As Vector3d = New Vector3d(0.0, 1.0, 0.0)" c: |" x. j/ M
Dim direction1 As Direction$ w/ i3 H. x6 W" _
direction1 = workpart.Directions.CreateDirection(origin1, vector1, SmartObject.UpdateOption.WithinModeling)" U$ ~( A- S4 C3 B& v4 e# E
block2.TransformMotion.DistanceVector = direction1 '移动方向
8 a- |. H. q- v2 @7 {. J' }3 W H9 O! P7 k
block2.NumberOfCopies = "3" '移动数量
, ]: T4 x6 d& d! L5 t! `1 B9 u1 E7 W v. {
Dim nXObject1 As NXObject, `) J, T7 `$ h9 H5 q# ^
nXObject1 = block2.Commit()
; z' W& Y. c. ?/ u, t7 k3 P+ g# o: Y2 e2 b5 B
上面红色那段代码怎么改写。请指教。(这是用JA录制的VB代码)9 M% t; H5 b$ J& z. T2 e5 ]8 D8 @
- N0 n+ D* J- I& ^" J9 u& } |
|