青华模具培训学校

 找回密码
 注册

QQ登录

只需一步,快速开始

青华模具培训学院
查看: 2134|回复: 1

[原创] 用VB.NET在UG中算冲压力

  [复制链接]
发表于 2020-1-17 17:04 | 显示全部楼层 |阅读模式
本帖最后由 tqtgmm163com 于 2020-1-17 17:13 编辑
) u# j! ?( k0 K* y/ ^; `$ X0 n8 T. J% S) s8 t  O/ j
'==============================================================================
6 r. \2 R5 e9 Q'  WARNING!!  This file is overwritten by the Block UI Styler while generating+ g3 s( {! z7 `" `/ Z' n" M
'  the automation code. Any modifications to this file will be lost after
9 }( b: Z0 {/ Y; Y$ ~1 g'  generating the code again.
- y+ v+ Z3 S6 F4 Z- ?4 J. o) r( D') L# v% Y: @) v0 W/ [  K2 \
'       Filename:  C:\dlx\press.vb
7 z" N; N- U* F  f  @1 Z; N# A, }: M'4 B: R4 M) A7 h+ r$ @2 `. \
'        This file was generated by the NX Block UI Styler: h3 A% g  i! w( \+ O3 G. |
'        Created by: Administrator
* K% K8 Z0 y: b) {% d'              Version: NX 8.54 Y6 C3 E5 W+ T1 P2 y: [
'              Date: 01-06-2020  (Format: mm-dd-yyyy)
/ l% I* Y0 A, q' _'              Time: 16:31 (Format: hh-mm)) B* ^& E- C0 s5 a+ g
'
/ s/ A- T1 w6 m7 t7 p$ b4 g'==============================================================================1 ?/ D! l& R, B+ S/ ]9 i/ L

/ C& _4 P3 y" r'==============================================================================
  }' t$ T  ]/ b'==============================================================================
: p+ }2 l$ l5 ]' d" n. |% l
& _& X: Z- }9 G'------------------------------------------------------------------------------
; L) R# s2 E6 I, \& _  c- }'These imports are needed for the following template code
( b, F' y/ M+ a- {'------------------------------------------------------------------------------
' ]/ n4 n2 f, fOption Strict Off  p' }) R3 y- |3 [
Imports System
  _% U  K2 l; R/ S" j2 lImports NXOpen
3 F6 |& j0 o- @. `& s7 j9 ]Imports NXOpen.BlockStyler$ ~  N; i0 Z; {) C9 _9 q
9 @( U5 X) g0 d( y& N. R
'------------------------------------------------------------------------------
8 I1 d8 W7 x3 H8 Y, L3 z5 g- n4 y'Represents Block Styler application class! g' [5 M8 l& L) B5 N9 W) w$ C
'------------------------------------------------------------------------------  ~: }: {2 h+ a7 }1 m, x# q
Public Class press
7 P4 l) F7 h. F# i) k" G7 M    'class members0 l% U* _6 ]9 i/ j# Z
    Private Shared theSession As Session
/ m2 L% @* z* }& \    Private Shared theUI As UI+ X' p7 y% t  f
    Private theDlxFileName As String
/ N6 D, r, K' z0 D* m$ d7 G    Private theDialog As NXOpen.BlockStyler.BlockDialog$ M! r2 m1 w  K. u& H
    Private group0 As NXOpen.BlockStyler.Group ' Block type: Group4 z4 u3 i8 Q6 ]
    Private linear As NXOpen.BlockStyler.LinearDimension ' Block type: Linear Dim
/ d" R  u$ v" Z! _( }    Private string01 As NXOpen.BlockStyler.StringBlock ' Block type: String5 v3 s$ h6 A$ ?
    Private string02 As NXOpen.BlockStyler.StringBlock ' Block type: String
$ Z+ L0 ~& i  Y8 q# n9 \: X3 ~# c    Private string03 As NXOpen.BlockStyler.StringBlock ' Block type: String
+ U' p" V9 r8 t. u( |8 |    Private string06 As NXOpen.BlockStyler.StringBlock ' Block type: String
' H7 X# _) b8 }- A9 n    Private string04 As NXOpen.BlockStyler.StringBlock ' Block type: String
: g' O$ k, g4 b    Private string05 As NXOpen.BlockStyler.StringBlock ' Block type: String
) A: c; e6 X0 Y    Private string07 As NXOpen.BlockStyler.StringBlock ' Block type: String/ }& ?" g; [2 L( T
    Private string09 As NXOpen.BlockStyler.StringBlock ' Block type: String
/ e2 C, f' V' i0 q' c$ j6 j    Private string010 As NXOpen.BlockStyler.StringBlock ' Block type: String- p4 x/ _, B- `& O; H5 x9 T: e
    Private string011 As NXOpen.BlockStyler.StringBlock ' Block type: String( h6 x, f4 r7 i" S7 F0 x- e7 u- b1 e
    Private string012 As NXOpen.BlockStyler.StringBlock ' Block type: String- C; X6 F& a. P+ N( t! z/ B' I; N
    Private list_box0 As NXOpen.BlockStyler.ListBox ' Block type: List Box3 S0 C0 L. K0 I% Y
    Public Shared ReadOnly SnapPointTypesOnByDefault_UserDefined As Integer = 1  N6 ^. L* M- K* r* v/ M! o0 @0 `0 W
    Public Shared ReadOnly SnapPointTypesOnByDefault_Inferred As Integer = 2
1 |& D$ G/ {) @    Public Shared ReadOnly SnapPointTypesOnByDefault_ScreenPosition As Integer = 4) _, E7 i) f; T
    Public Shared ReadOnly SnapPointTypesOnByDefault_EndPoint As Integer = 86 ~$ t$ [0 S8 j8 {
    Public Shared ReadOnly SnapPointTypesOnByDefault_MidPoint As Integer = 16! w( k2 H( s) @, W* v$ m
    Public Shared ReadOnly SnapPointTypesOnByDefault_ControlPoint As Integer = 32/ M. ]5 g. I$ o
    Public Shared ReadOnly SnapPointTypesOnByDefault_Intersection As Integer = 64' |+ K1 W0 X1 j8 [7 [
    Public Shared ReadOnly SnapPointTypesOnByDefault_ArcCenter As Integer = 128$ P7 _& t8 z  V
    Public Shared ReadOnly SnapPointTypesOnByDefault_QuadrantPoint As Integer = 2567 F" d  @) T6 a1 S
    Public Shared ReadOnly SnapPointTypesOnByDefault_ExistingPoint As Integer = 512
/ [$ ^) Q7 e3 s# w    Public Shared ReadOnly SnapPointTypesOnByDefault_PointonCurve As Integer = 1024) k7 z' A" o3 f' S9 s% N9 y/ C
    Public Shared ReadOnly SnapPointTypesOnByDefault_PointonSurface As Integer = 2048
) ?- d" U# R3 g4 v7 u: l0 Y    Public Shared ReadOnly SnapPointTypesOnByDefault_PointConstructor As Integer = 40966 Q6 j4 k/ q# j$ P" |
    Public Shared ReadOnly SnapPointTypesOnByDefault_TwocurveIntersection As Integer = 8192
' O& U" Z) C3 O7 C- ?    Public Shared ReadOnly SnapPointTypesOnByDefault_TangentPoint As Integer = 163840 l$ h& q4 y2 h7 A/ i) s# U2 B
    Public Shared ReadOnly SnapPointTypesOnByDefault_Poles As Integer = 32768
) F3 {. `, S. L/ D* n+ V) m    Public Shared ReadOnly SnapPointTypesOnByDefault_BoundedGridPoint As Integer = 65536% A" P4 F' u2 S9 `# v' `8 A) t

0 @: Z- e2 u+ @- E0 @- s! I  u#Region "Block Styler Dialog Designer generator code"6 A) s' e; {0 T. V4 x4 P# X9 J2 {1 h
    '------------------------------------------------------------------------------# M; g4 E5 \5 K, `3 n% x9 t# Q
    'Constructor for NX Styler class
. O3 B8 d+ m$ |, ]8 W/ H    '------------------------------------------------------------------------------6 P. r! @2 {3 e# `4 [* y. g
    Public Sub New()
5 {6 D1 X9 s+ {) b0 m        Try
7 i1 H# w; J2 K. I. _7 z8 S
4 h; s/ d3 q$ B! G4 }            theSession = Session.GetSession()3 ~$ y) |' H' u6 M
            theUI = UI.GetUI()
% X; R3 _' e. C& W/ }9 Q) X            theDlxFileName = "D:\LIS_ug\TOOL1\PRESS-A01.dlx"- ~5 l! m. b' Z# Z. J' H$ l& \
            theDialog = theUI.CreateDialog(theDlxFileName)
" P% \! W7 u* R( ?7 F/ z            theDialog.AddApplyHandler(AddressOf apply_cb). w3 n. D# ]) i0 M) F. e$ K$ z
            theDialog.AddOkHandler(AddressOf ok_cb), B2 r; D3 n8 Y8 y4 k. R( b
            theDialog.AddUpdateHandler(AddressOf update_cb)
' }% X$ {7 [* |0 B: ~1 i0 t  V0 i# p            theDialog.AddInitializeHandler(AddressOf initialize_cb)  ^9 _$ s# a# x! P* _
            theDialog.AddEnableOKButtonHandler(AddressOf enableOKButton_cb)
4 z+ W* G1 r7 e2 z: n' G! J9 f, Z            theDialog.AddDialogShownHandler(AddressOf dialogShown_cb)
( V* Q6 [1 r; E/ o' G) v  D5 l- r% P
        Catch ex As Exception' o, ~# c2 F: d, p8 \
* K2 X0 d# X" f  v, l
            Throw ex7 n% t6 S6 b$ _- f) \3 c( `
        End Try
, ]7 k2 `; a( y' Y4 Q4 ]    End Sub
7 U3 l6 N6 b  F& |7 ^* P#End Region
; s  |& B0 q' E) x/ o; o; s! ^
7 r; p7 M  D  T5 a3 n/ H/ M' `    Public Shared Sub Main()
2 Y% y# }* f' A4 {+ B7 S& X* n# E0 x        Dim thepress As press = Nothing- A/ O, r% o( Z- J& k
        Try4 e0 f. w8 l5 a. \. N

. u+ w0 X7 M4 D; I            thepress = New press()) Y  y3 }+ C1 _' {& s, E. n% G
            thepress.Show()
; c1 z# f7 |! e) e# t& ~: m( p0 d! ^
        Catch ex As Exception
2 y& Z3 R! `$ R1 A; B9 h8 ^
9 [( Z0 u1 v! \! `7 Q            theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString)1 a* k3 j+ R. q/ J+ `' t
        Finally
! C6 Y' ]% ~# R; c" g            If thepress IsNot Nothing Then# S2 k* e5 V# D/ N$ k  N
                thepress.Dispose()
6 U6 |! @' r) ?5 h+ p                thepress = Nothing
; ^$ [6 Y' e3 {, z; d. D            End If! q4 A4 q0 B8 b& P; U  l( q* c; f
        End Try6 }: N- ~- x& [# z
    End Sub
5 }- z3 Y% N+ B, u    Public Shared Function GetUnloadOption(ByVal arg As String) As Integer
% m* p# E3 [8 D" x5 o& }        'Return CType(Session.LibraryUnloadOption.Explicitly, Integer)7 d1 W, H7 K4 }8 C$ y
        Return CType(Session.LibraryUnloadOption.Immediately, Integer)
7 ?2 w' B. q3 }+ y* u9 t        ' Return CType(Session.LibraryUnloadOption.AtTermination, Integer)
! e% f' p+ s- i5 ^8 F! u  ~0 Y& v) _    End Function  v: Y& o4 e0 G/ D$ f! T( x/ _
    Public Shared Sub UnloadLibrary(ByVal arg As String)
( o+ v# |- Z% j' n; e. f( P        Try
5 ]8 |# m# Z1 x: z* L7 U  q# f4 D+ k) w
# K8 r) t0 \: [) M: B- r
& }# b2 A9 a' _+ v! M        Catch ex As Exception7 ~% _. O; _, h8 b3 ]/ C

% @% x0 E+ {0 z2 I            theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString)/ \9 y$ F, w# L, E4 i
        End Try2 \: e- ?; c  Q4 x+ q8 a
    End Sub
! n0 b% d% @) h& o0 Y: t, N: D& V8 U& Z8 [
    '------------------------------------------------------------------------------# ^0 Q- v; A' \0 D! ^; T
    'This method shows the dialog on the screen
' ]8 U9 G! N- }$ K. p9 i  V    '------------------------------------------------------------------------------, n1 C4 H3 M" R5 A6 s
    Public Sub Show()
* ]% Q0 l8 ]3 n% L& Y- ]        Try. T6 R0 O5 @; l. m9 z0 k
% Y% H, c2 Q3 J; K2 ?" e: ^, n+ k5 ]
            theDialog.Show()" j: V: n( S& e* l7 k2 E1 K9 H
5 d* ^7 u; Z$ S5 n% Z: {
        Catch ex As Exception
2 c6 Z' b" Y4 {5 S$ g) B6 r) W/ [/ A) j
            theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString)
/ [( j) G6 E  H        End Try- Z& U# E$ ?. g: O0 B
    End Sub0 ]' M0 {& y& X8 w

6 G& c' y+ s' w3 _' d# V( t    '------------------------------------------------------------------------------
6 R0 l6 y) Q+ t2 U, j0 `) Y0 c    'Method Name: Dispose
  Z/ u  N6 u' X    '------------------------------------------------------------------------------
2 f/ h  o  A4 u/ N' U    Public Sub Dispose()
- ?) |# ?; X" G        If theDialog IsNot Nothing Then, f% }- T) M! A9 N5 q6 J
            theDialog.Dispose()
  D5 o- b/ Y% v1 l, {8 ?4 j            theDialog = Nothing
- B3 X! e5 q0 M3 G        End If9 K8 h. v7 O/ S  M8 C
    End Sub0 _$ h& I* K! h# s! O+ U

7 B* ]; h* v# \) T+ B! D% k4 v, q* l1 F+ D0 k4 b1 m  t
    '------------------------------------------------------------------------------
0 t* q; w) ?! i; G& a1 P    'Callback Name: initialize_cb9 ?1 u2 e- _' M& t# |& W
    '------------------------------------------------------------------------------
4 ~- W: s- [' ]8 g) D1 @  E: B    Public Sub initialize_cb()( Q7 L* b! j& f
        Try) M+ C" ]5 O7 P% |
: I' ]% Q! d' T6 j+ E- }% y2 C
            group0 = CType(theDialog.TopBlock.FindBlock("group0"), NXOpen.BlockStyler.Group)2 I# a, e5 H7 B, V
            linear = CType(theDialog.TopBlock.FindBlock("linear"), NXOpen.BlockStyler.LinearDimension)  L, h  p! B) e7 r3 J' A
            string01 = CType(theDialog.TopBlock.FindBlock("string01"), NXOpen.BlockStyler.StringBlock)* B+ N' m0 r, T! k8 T
            string02 = CType(theDialog.TopBlock.FindBlock("string02"), NXOpen.BlockStyler.StringBlock), |9 u; D# p6 g  W
            string03 = CType(theDialog.TopBlock.FindBlock("string03"), NXOpen.BlockStyler.StringBlock). V4 p" _2 s1 b3 _! J
            string06 = CType(theDialog.TopBlock.FindBlock("string06"), NXOpen.BlockStyler.StringBlock)
/ l. p5 L; P8 a+ g/ Z* P. H+ q8 \, _            string04 = CType(theDialog.TopBlock.FindBlock("string04"), NXOpen.BlockStyler.StringBlock)
' U# w7 A, @, X" F; i7 P8 C" }; ^            string05 = CType(theDialog.TopBlock.FindBlock("string05"), NXOpen.BlockStyler.StringBlock)
+ [2 m& K% Q# N# O            string07 = CType(theDialog.TopBlock.FindBlock("string07"), NXOpen.BlockStyler.StringBlock)9 G( h0 S! J' O+ W, o9 {# D3 _
            string09 = CType(theDialog.TopBlock.FindBlock("string09"), NXOpen.BlockStyler.StringBlock)
7 r# S* \9 S( W            string010 = CType(theDialog.TopBlock.FindBlock("string010"), NXOpen.BlockStyler.StringBlock)
9 P1 k* f: F% T  \6 b            string011 = CType(theDialog.TopBlock.FindBlock("string011"), NXOpen.BlockStyler.StringBlock)1 P  ^+ P; s. _( V4 \
            string012 = CType(theDialog.TopBlock.FindBlock("string012"), NXOpen.BlockStyler.StringBlock)2 \' Q' J8 S! H) {
            list_box0 = CType(theDialog.TopBlock.FindBlock("list_box0"), NXOpen.BlockStyler.ListBox)( \) n$ a3 ]7 {3 D: w+ n6 J+ Y- m
) v8 I- _% a- X& Z
; P* K2 i9 B# ^5 w' n: G6 H

7 i5 s, k* d0 ~* f- Y        Catch ex As Exception8 D8 s  a5 y' v1 n3 |

0 V& I( x( U. e, m            theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString); j5 q7 I! P0 `2 N* u- i( |
        End Try
3 ~( g% {+ v0 k    End Sub9 h5 }$ _, K# x/ N) S# q+ A5 s

: T6 k6 F1 y: k( q2 [9 \( z# N" o; w    '------------------------------------------------------------------------------' {- R0 O" o/ _  i( O
    'Callback Name: dialogShown_cb- k0 f3 B6 ^4 h7 x+ A
    '------------------------------------------------------------------------------
9 A- n- f6 v4 l3 i+ N- d    Public Sub dialogShown_cb()
9 \2 `6 p% [( B. e: e; c7 K        Try# x# Z3 N( |" N/ `& A
, A0 s0 y, t" `. A% [" y0 e& B
. F$ R5 @% Q7 r7 ~9 \
        Catch ex As Exception
! I2 X* u: `" ?/ g. z1 r
9 e( ~- g: N+ y8 q/ v            theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString); m* a  X) ~7 f2 _; F
        End Try1 `+ ]. _' P9 T/ V2 a; e
    End Sub4 i0 M! y9 d, R, d: A% u

- |% ^& z6 }" N: S' B* S    '------------------------------------------------------------------------------- U- E' A* X) Q. E4 q
    'Callback Name: apply_cb
) t& w& k( f9 F    '------------------------------------------------------------------------------
8 k  s+ {  f2 }6 t& d    Public Function apply_cb() As Integer
/ f# J& E* K. K        Dim errorCode As Integer = 0
5 q0 \6 u: _! {' w1 Z        Try
# v3 x% n/ [0 C) t4 }) ^
9 Y+ S. D2 V# c- L, W4 O/ k$ q% o4 ]. |3 J. ~# x& N
        Catch ex As Exception
$ p1 ]  _# w0 H) d3 w- H! i& T# f) @$ B
            errorCode = 13 L' x; t2 [( Z- o  B- q" W; |  [
            theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString)
/ r2 k5 C/ L5 H- r% s  k6 \* a5 w; \        End Try
* ]. p( c! l; ]4 I$ M0 B        apply_cb = errorCode
' f, J1 A( J9 \, p. Y0 Y    End Function
* J8 X1 n2 c% k6 Z) P& T; P+ J: g
8 ?; j: b' g8 m5 Y    '------------------------------------------------------------------------------9 [7 G  D( s$ R$ ^
    'Callback Name: update_cb5 n! \, r* @3 ~6 B
    '------------------------------------------------------------------------------
6 b& s1 _  g! n' Z; I0 A    Public Function update_cb(ByVal block As NXOpen.BlockStyler.UIBlock) As Integer, w4 ?; @6 Q0 V% U& j8 n+ o  J! |8 m
        Try
8 j# T, C; o$ D
& l5 t9 q+ E! n+ J! h            Dim num As Single = CType(linear.Value, Single) '转浮点数
& o: h' F5 Q$ j( H            Dim aa3 As Decimal = Math.Round((num * string01.Value * string02.Value * 0.001), 3) '3位小数
- V- q, }2 M& {            string03.Value = aa3
$ r+ C( N! J" u) [  f9 P( L0 m% L            Dim aa4 As Decimal = Math.Round((string03.Value * 0.8), 3) '3位小数7 O& R  M7 r9 Q
            string04.Value = aa4( y6 b) z* K+ u! D/ ?) R/ Y+ E
            Dim aa5 As Decimal = Math.Round((string04.Value * 1 / 6), 3) '3位小数% e; K( q0 ?9 p/ L
            string05.Value = aa5
& d" G8 ~! i0 G& o  h( H, M! p            Dim aa6 As Decimal = Math.Round((string03.Value * 0.06), 3) '3位小数' M9 P8 m& j2 g  d/ ]) F
            string06.Value = aa6% U1 N0 q/ h+ l
, W, q% {0 S& a  |# q
            Dim a3 As Single = CType(string03.Value, Single) '转浮点数: I4 j) |) `' W# t# S( D
            Dim a4 As Single = CType(string04.Value, Single): G5 @+ i8 e7 y; g6 b  X
            Dim a5 As Single = CType(string05.Value, Single)
( F# d- z/ E: l! M/ V/ |& G            Dim a6 As Single = CType(string06.Value, Single)
6 i9 Z! y2 E/ M+ S0 K
$ y2 J; ^7 K% ?) K0 K. P' Q            Dim b3 As Decimal = Math.Round(a3, 3) '3位小数: X2 a0 D1 X- M6 g8 B9 Q3 _& w
            Dim b4 As Decimal = Math.Round(a4, 3)
# _) F  H3 ^1 ?1 K6 L2 B$ X            Dim b5 As Decimal = Math.Round(a5, 3)8 I: W5 Y  `% t9 w) H
            Dim b6 As Decimal = Math.Round(a6, 3)$ [! ^* h) _0 ?( H9 V% Q

4 F( q) ?$ W' `6 S$ c# o( i; J& M/ u0 }/ h( \1 |& d
            Dim d1 As Decimal = Math.Round((b3 * 1.3 + b6 * 1.3), 3) '2位小数
/ }* \  v3 T) D/ I& g/ W            Dim d2 As Decimal = Math.Round((b4 * 1.3 + b5 * 1.3), 3)- d/ [, s* ?" a% H! D- |/ t) w

) j9 V$ J5 S1 M( y! k& w- z4 X            string07.Value = d1
6 z& O* S7 X1 F% n' P            string09.Value = d2
7 F7 U. _; I' R2 q7 I3 q$ A( o8 N! G, J# X1 o

4 w9 a$ a) F: M# T) w8 Z( Y5 X            Dim a As Single = CType(string010.Value, Single) '转浮点数7 s" z8 Y" T: e1 P: h
            Dim b As Single = CType(string011.Value, Single). T  U4 r* R" n. ]' Y
            string012.Value = a + b
8 w7 x  g" `' c% S! e9 C  c
! c2 }# F! H: S  @$ m7 X5 E2 k
/ c4 |$ j( x4 l" K* G( S/ V& C7 ]. l% y; \# d

( m# U5 z" J) r0 m+ @: r  g! k" J+ k0 q- Y( Q7 k9 V
        Catch ex As Exception
& r& P) F- z$ D+ `
4 u2 m6 a4 V! n# f            theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString)$ W- @/ P' b0 L+ |) [
        End Try
( Z7 }7 B' Z" i        update_cb = 09 q7 V. W7 U$ D
    End Function  T. Z$ x- E& N! B
+ H; k8 ?/ K7 P$ B' f- I
    '------------------------------------------------------------------------------4 N4 _! u2 {5 _, P
    'Callback Name: ok_cb
1 \6 n7 z# U* \6 ]7 j& ?6 V( L/ ~    '------------------------------------------------------------------------------+ x8 m+ R; d- _9 R' M& P8 m: n8 D
    Public Function ok_cb() As Integer
. m" T- D- a! s3 ]' O        Dim errorCode As Integer = 0( P9 m/ ?- n0 B
        Try% M) m$ L# M& k3 ]% H9 S2 n$ {' Y

/ y5 _2 G3 H+ }; f7 k* K8 |) E5 x            errorCode = apply_cb()
2 w+ l; A3 P+ ?+ d& M- }6 a- l) e7 `5 Q, V0 \* G
        Catch ex As Exception0 [0 {3 w: T( J6 N& G# X: M- k

: a/ W1 Z1 ^9 E- }            errorCode = 1
. Q2 n2 z! P* k- r, f3 B% J5 S            theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString)) c, n6 E7 S8 f) \/ \
        End Try, C6 z8 B6 H! h9 G
        ok_cb = errorCode4 }/ P  D* ^9 g; m. u( B- C
    End Function
# B& O  b; [9 I0 E6 {. [9 v" E8 _; _: T
    '------------------------------------------------------------------------------+ M! E5 v( `8 Z. m
    'Callback Name: enableOKButton_cb
1 E/ `4 c- F0 ~2 `1 ]% Q) t5 q    '------------------------------------------------------------------------------; U* E, t0 q. l' B
    Public Function enableOKButton_cb() As Boolean
) R, ~3 v: |, {& [% {        enableOKButton_cb = True" d4 r7 Q' a* A  {  Q
        Try
, g1 s& g! y$ D7 _7 Q6 ~& W6 {$ o
& j, K4 s3 v3 u" c3 i$ f, j
        Catch ex As Exception- x6 J5 i* a3 O: p- F

( S. R! F8 C# D* K            theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString)
; P/ m( t2 C& W1 e        End Try7 O( [6 d' W- o8 v" l! M0 w
    End Function
% h% S3 z/ u' h0 b1 D1 x5 M4 R0 J2 P  z6 Q/ {3 u

& `0 N* [2 I5 n- |+ e) |
, Y* U% l9 }* x, A) D" K) v' u2 {    '------------------------------------------------------------------------------& N% R' J# \" B, o3 N  a) S: [; Q1 C
    'Function Name: GetBlockProperties" q7 t0 J$ J0 e1 p" o& z) O
    'Returns the propertylist of the specified BlockID
5 U7 x, F+ u* d1 s) ?6 n    '------------------------------------------------------------------------------
* `' y3 _9 p7 q    Public Function GetBlockProperties(ByVal blockID As String) As PropertyList
6 R/ _% O1 V: W        GetBlockProperties = Nothing) I4 T' F2 _- m
        Try
1 N6 K* O) E2 V/ a: O) N6 \' A% w5 `7 I
            GetBlockProperties = theDialog.GetBlockProperties(blockID)
* A4 n9 D" _$ ^( l) h5 F
2 }/ V' m  g* c        Catch ex As Exception; {  T! X& o* W, _
2 i% l+ Y! B1 u( z/ H; U) m% Q
            theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString)$ j5 `3 P/ m2 H
        End Try! s: E# T+ G+ A. P) R
    End Function
# `  {- t3 Y( O- I6 z$ T
! S7 B- _0 {0 ^2 Z1 r$ y& S, sEnd Class
* Y- j( G. a0 |& ]1 |/ |: b6 o, ~! G4 f1 {

$ R6 Q! `- |8 L/ p9 e
press.JPG
1.JPG

press.rar

11.39 KB, 下载次数: 0, 下载积分: G币 -1

源码

发表于 2022-9-11 21:41 | 显示全部楼层
       string07.Value = d1
. v- e3 }" a1 _! B6 i        string09.Value = d2
; w. {. v6 j" L% c  ]不报错吗?
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|关于我们|sitemap|小黑屋|Archiver|手机版|UG网-UG技术论坛-青华数控模具培训学校 ( 粤ICP备15108561号 )

GMT+8, 2025-7-1 21:56 , Processed in 0.158712 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表