|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
'NXOPEN创建方块体的方法
0 Y# E3 f/ F6 O8 n3 H& [6 E6 g, g Dim block1 As Features.BlockFeatureBuilder
: D" G; }( W; T2 J( k Dim point1 As Double = 6. f2 T3 ]0 O y" N' r$ P
block1 = workpart.Features.CreateBlockFeatureBuilder(Nothing)% z" v, x0 p8 j! N ~% C6 d/ [
block1.SetOriginAndLengths(New Point3d(-6, point1, 0), "12", "12", "6")
( c: O% r3 C' L- ]% L6 ]; s Dim feature1 As Features.Feature: v" x5 D& H" J$ M7 X
feature1 = block1.CommitFeature()
' W s: Y. [6 L0 N; y4 S) J- E% I
- e2 J( u) t) ^ {! w, L S
% w' M: s3 B% I7 y. w" ~! C '以下是移动体, ?7 ]% L# `( ^; j* \ e3 @3 H
Dim block2 As Features.MoveObjectBuilder
, K+ j* W d# ^9 A! m4 h block2 = workpart.BaseFeatures.CreateMoveObjectBuilder(Nothing)3 E, e; ~& y& w! @7 I: {" y: D8 |" u
6 f( Q" n9 T& h% S8 f
block2.TransformMotion.Option = GeometricUtilities.ModlMotion.Options.Distance+ ^) ~0 ^/ `/ o' ^% A. A0 O6 z# A1 K
block2.TransformMotion.DistanceValue.RightHandSide = "50" '移动距离) c. n" r3 U0 {0 F
block2.MoveObjectResult = Features.MoveObjectBuilder.MoveObjectResultOptions.CopyOriginal
5 H5 N. a- l3 n' n; K# @$ I- W9 L0 u; i! s+ A5 y
block2.ObjectToMoveObject = Add(block1) '要移动的体: J g( X9 r8 O4 z2 `
0 @ e: I( c% Z" X0 i7 I$ s
Dim origin1 As Point3d = New Point3d(0.0, 0.0, 0.0)
& v+ u! w- ?/ R- X8 |( z7 ~2 n/ c Dim vector1 As Vector3d = New Vector3d(0.0, 1.0, 0.0)8 G2 h! d7 }! _2 O. h2 Z
Dim direction1 As Direction1 J: [; P( A+ q
direction1 = workpart.Directions.CreateDirection(origin1, vector1, SmartObject.UpdateOption.WithinModeling). b" M; F6 t' ^* ^0 g. M# s
block2.TransformMotion.DistanceVector = direction1 '移动方向2 ]5 X V1 |9 W! c
, {1 Z. {8 s' E' X$ h; |' Y: F- _
block2.NumberOfCopies = "3" '移动数量
% B& Q8 S% D, x7 m7 i& t7 Y4 ^( G3 M, C
Dim nXObject1 As NXObject
6 F# s( {# d, l6 F! F- ^1 h; K nXObject1 = block2.Commit()
( `+ `) @7 a" n
' F2 k. B7 k; N上面红色那段代码怎么改写。请指教。(这是用JA录制的VB代码)
4 b% U( T8 ^* ]- O! u! j- E: m& v
4 o* Q& P. x' H* n/ U |
|