青华模具培训学校

 找回密码
 注册

QQ登录

只需一步,快速开始

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

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

  [复制链接]
发表于 2020-1-17 17:04 | 显示全部楼层 |阅读模式
本帖最后由 tqtgmm163com 于 2020-1-17 17:13 编辑
& Z; k! I" d0 M) ?2 |+ ?9 {9 @) h- c
'==============================================================================
8 c" P" O( k2 G- N; W'  WARNING!!  This file is overwritten by the Block UI Styler while generating' N: @+ M3 d/ Q. V5 e7 o7 Y; w
'  the automation code. Any modifications to this file will be lost after( i1 n7 r7 H0 |: y3 M! j* \, b
'  generating the code again.' x4 m: `( O( N( W
'
: c- v0 w( h' Z- x% q, \- \3 e7 T'       Filename:  C:\dlx\press.vb" Y0 J8 L( y9 o2 g
'& k% W- e. l& q& h) P
'        This file was generated by the NX Block UI Styler/ |& D7 R( Z) j1 z5 {6 W6 B4 @
'        Created by: Administrator
8 c2 [3 r* l# F$ H'              Version: NX 8.5$ E5 ^' V% h) F3 \, L7 F5 c; Z9 x
'              Date: 01-06-2020  (Format: mm-dd-yyyy)2 R0 ~0 u. G+ P" G: x5 d$ |
'              Time: 16:31 (Format: hh-mm)$ y' k" ^6 P* J
', T) k8 t+ `  O4 q9 H
'==============================================================================
: r% V4 l9 q2 M% Y3 B0 a
; `' }; K0 [/ i, }, B6 L3 {'==============================================================================
! J- e( R. S, t' Q1 l'==============================================================================# H9 L& n* @# p/ Z6 k

+ R  o3 M7 s7 @5 h) d. r'------------------------------------------------------------------------------
1 x1 K. l/ l, h7 b* V'These imports are needed for the following template code
7 k9 W& p3 c0 Q& _# i3 u'------------------------------------------------------------------------------
" v/ q: x0 V  F+ \. i; n9 ~5 COption Strict Off
5 E$ ?' y# g+ r# C. \) H4 e) u. M2 h8 |Imports System3 ~- M9 E6 D: N2 u
Imports NXOpen
1 a9 g' j) p5 R( h1 n% bImports NXOpen.BlockStyler; ]& n( \2 Z7 F6 I/ l2 [5 M
% ?; b7 t# z" W" K) k* R0 A7 A' g- O
'------------------------------------------------------------------------------# I; @8 E$ Z9 w4 t) `0 J
'Represents Block Styler application class0 Z4 F- ]1 r+ v
'------------------------------------------------------------------------------
% N9 r: [4 w7 R1 {* S! HPublic Class press$ u1 n/ F9 ^. r0 o5 V) x( g; U9 t
    'class members+ ~' {' P* Y) S* N
    Private Shared theSession As Session
5 h& e/ C0 _( k7 [+ p' |' a    Private Shared theUI As UI
. ~' x; z7 D0 F9 g6 }1 e# x    Private theDlxFileName As String) F% O9 `( d  i: Z) a* n
    Private theDialog As NXOpen.BlockStyler.BlockDialog
3 ^/ J* S  d/ w  `    Private group0 As NXOpen.BlockStyler.Group ' Block type: Group
1 g0 A2 n, K  k% O    Private linear As NXOpen.BlockStyler.LinearDimension ' Block type: Linear Dim
. ~( N9 b8 n7 I9 X    Private string01 As NXOpen.BlockStyler.StringBlock ' Block type: String
" Y* k+ H' j7 o. }, ?7 w! s6 k9 l    Private string02 As NXOpen.BlockStyler.StringBlock ' Block type: String
5 l! `& G, |6 s! l6 s    Private string03 As NXOpen.BlockStyler.StringBlock ' Block type: String4 C8 g/ z7 J: z9 P5 T# Q8 c
    Private string06 As NXOpen.BlockStyler.StringBlock ' Block type: String
8 S, ?6 z" w3 D. v2 o' C3 q- T+ d$ }    Private string04 As NXOpen.BlockStyler.StringBlock ' Block type: String
  P7 q' d; I, |    Private string05 As NXOpen.BlockStyler.StringBlock ' Block type: String
$ F8 K2 m' _$ H$ s8 S2 W7 U    Private string07 As NXOpen.BlockStyler.StringBlock ' Block type: String
9 l2 Y8 r* }# T# h+ k3 O/ f    Private string09 As NXOpen.BlockStyler.StringBlock ' Block type: String
4 Q) `( {1 ?4 O# f4 g    Private string010 As NXOpen.BlockStyler.StringBlock ' Block type: String1 Q' O) u# H! W3 m! P/ r; Y
    Private string011 As NXOpen.BlockStyler.StringBlock ' Block type: String% a# ~1 E, x: s# X  U* a
    Private string012 As NXOpen.BlockStyler.StringBlock ' Block type: String' u+ ~# k" k" D
    Private list_box0 As NXOpen.BlockStyler.ListBox ' Block type: List Box
1 C) A) I" U" s    Public Shared ReadOnly SnapPointTypesOnByDefault_UserDefined As Integer = 1
7 {5 o5 y5 x7 P, l2 ]: I    Public Shared ReadOnly SnapPointTypesOnByDefault_Inferred As Integer = 2
9 A( n7 q- ]; G4 ?/ P6 ~3 S    Public Shared ReadOnly SnapPointTypesOnByDefault_ScreenPosition As Integer = 4
( ^9 |5 c/ f- B7 u    Public Shared ReadOnly SnapPointTypesOnByDefault_EndPoint As Integer = 8
5 O* j9 c" B. L, J9 ~: ?0 ^    Public Shared ReadOnly SnapPointTypesOnByDefault_MidPoint As Integer = 16
" R5 }0 W+ V! C2 }/ |    Public Shared ReadOnly SnapPointTypesOnByDefault_ControlPoint As Integer = 32/ c; {4 {) s6 g
    Public Shared ReadOnly SnapPointTypesOnByDefault_Intersection As Integer = 64
4 X! f* ^1 f# p8 z    Public Shared ReadOnly SnapPointTypesOnByDefault_ArcCenter As Integer = 128
& \' J8 G. ~" f    Public Shared ReadOnly SnapPointTypesOnByDefault_QuadrantPoint As Integer = 256( \! V* p4 O0 n0 N$ c* l& n
    Public Shared ReadOnly SnapPointTypesOnByDefault_ExistingPoint As Integer = 512
7 q$ T: r9 d6 m% ]    Public Shared ReadOnly SnapPointTypesOnByDefault_PointonCurve As Integer = 1024
$ s; a1 m0 a' |: o0 i9 _2 {$ |! `    Public Shared ReadOnly SnapPointTypesOnByDefault_PointonSurface As Integer = 2048; ^% c+ Z& D6 m. v( B* V
    Public Shared ReadOnly SnapPointTypesOnByDefault_PointConstructor As Integer = 40964 A8 B+ Z" n6 h8 ]# A; a
    Public Shared ReadOnly SnapPointTypesOnByDefault_TwocurveIntersection As Integer = 8192
' Y6 A) p7 F( n( V7 ~    Public Shared ReadOnly SnapPointTypesOnByDefault_TangentPoint As Integer = 16384+ S8 Y- j' ^1 U+ K6 y
    Public Shared ReadOnly SnapPointTypesOnByDefault_Poles As Integer = 32768
; \' W9 l* _3 l; e0 b    Public Shared ReadOnly SnapPointTypesOnByDefault_BoundedGridPoint As Integer = 65536
, G8 D6 }; s7 W2 z% T* h% d' B6 T. L& @- m
#Region "Block Styler Dialog Designer generator code"
" S- M% c) @- J- p, ?    '------------------------------------------------------------------------------
9 H0 y+ [& D- ?! r# C    'Constructor for NX Styler class
  r: w6 U1 t* _) \; y; x    '------------------------------------------------------------------------------: a8 V7 e- O( b% d( J
    Public Sub New()1 }' z. m: n% S2 i% x; z$ a; Q7 \
        Try7 u9 S5 q  P' q7 k- g( V: e
7 T4 _( D9 [9 _3 }
            theSession = Session.GetSession()
( D& ~7 N3 v, D0 S$ U$ x8 q            theUI = UI.GetUI()6 e: c: t8 m* t/ N1 Q' N- K5 g
            theDlxFileName = "D:\LIS_ug\TOOL1\PRESS-A01.dlx"
9 N3 j3 I6 K- z, \- q- H' o            theDialog = theUI.CreateDialog(theDlxFileName)
! x* b# _$ s1 a( K+ `9 C# z            theDialog.AddApplyHandler(AddressOf apply_cb)8 T9 t. f  }; n0 V  l& D+ ?
            theDialog.AddOkHandler(AddressOf ok_cb)
& Z( L6 b$ O1 y8 j            theDialog.AddUpdateHandler(AddressOf update_cb)$ M! y5 [2 |& S* W( i' R
            theDialog.AddInitializeHandler(AddressOf initialize_cb)
& U2 G! f7 l4 d0 T4 @+ V. L% K+ a' y            theDialog.AddEnableOKButtonHandler(AddressOf enableOKButton_cb)6 p0 |- r( C- [9 z! O8 A: v
            theDialog.AddDialogShownHandler(AddressOf dialogShown_cb)
9 K; e1 l- a7 j" K9 g! Z8 F8 Z, w1 b- Q5 N- {* e
        Catch ex As Exception
8 l- O+ j& Q. }# o9 q) U1 D
$ Y- A/ d  R' M- _            Throw ex% I$ N* X0 g) Y  s* |5 W
        End Try1 s0 ]7 Z) d  b6 F
    End Sub* |; u/ t1 |) A+ d, _
#End Region1 s1 I) `. @2 O) R+ P( O: N: v

# J6 l# Y+ O& g/ F    Public Shared Sub Main()
: W& Y: e- M2 @        Dim thepress As press = Nothing
2 V$ r9 W) @# J* z  D        Try$ v0 Q+ ?4 e3 ?  O# c

8 W9 D! `+ c$ K" y( ^  h            thepress = New press(). e+ ?. `3 Z0 B- X; N
            thepress.Show(): X9 V/ }6 c5 }0 ^# i" i% B$ j

) g& l1 `" ^7 P" F        Catch ex As Exception
1 R. _+ [+ m6 X+ a1 u7 \- h
! V& N% e- m& r            theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString)
8 _3 S8 g8 i5 z1 P9 a        Finally* q) ]* u3 m2 I. H9 F+ I) u7 g
            If thepress IsNot Nothing Then
4 _5 ^  r: ~2 @  L( `0 x- u+ c. L  U                thepress.Dispose()$ I! J% V  y& Q! W
                thepress = Nothing# O7 `. Z+ Y7 ]/ B
            End If
9 J  g' \' X3 k' V        End Try- Q, q$ y, D% ~. _/ _6 K$ Z7 _( @
    End Sub
% d: C/ `/ v3 b, p* {0 l( m$ N    Public Shared Function GetUnloadOption(ByVal arg As String) As Integer# I9 ]) X' b5 z1 E; r9 h# `/ F' S
        'Return CType(Session.LibraryUnloadOption.Explicitly, Integer)  R' }5 G% A6 D% D! A7 F
        Return CType(Session.LibraryUnloadOption.Immediately, Integer)0 Q( |( ?% p2 c4 I* S
        ' Return CType(Session.LibraryUnloadOption.AtTermination, Integer)
  U! _2 ^3 O9 m    End Function
6 L6 G. n$ z( R, h, R% Z    Public Shared Sub UnloadLibrary(ByVal arg As String)
; N' ~7 ^/ d7 r: K4 y+ ]' X        Try5 b- O6 H7 n3 Z
* L- {$ r  D: M9 C8 A8 r- p( C

# ~4 V4 u. [" f8 p" }$ h$ ^        Catch ex As Exception( S' B; {' w7 @+ ^+ a1 E8 v2 L

) h$ o; b: i* X+ I3 @1 j            theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString)
1 a! M2 {: f, i) T2 r        End Try
" @8 ?: K7 X' S6 W3 @3 x2 @1 d+ d2 N( H7 W    End Sub
* \$ B  b; K0 Q+ x/ S' ]! o
6 M: A3 N) ~5 R" \$ E8 ?8 o, m  E& s    '------------------------------------------------------------------------------
( K2 }# M7 m8 ~! O3 h# h: w4 Q    'This method shows the dialog on the screen
8 y1 k: a+ K. s0 q2 x    '------------------------------------------------------------------------------  V% d7 p( ]. G: a
    Public Sub Show()
, F( d6 {$ M0 B& l/ _        Try+ }, D+ \( P6 j2 Z2 v% C2 N
" H  ^5 C* n1 M$ y# {9 V: U, U
            theDialog.Show()
0 d1 p; l" s* o6 s1 G
) g" M9 {7 g9 n) J7 S% B" y        Catch ex As Exception, j+ }. Y0 r! P7 o: e
) n" q- y3 |% Q( f6 ?3 A: Q
            theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString)6 v' V0 C  s$ p' o2 W
        End Try5 y* n- Q8 T/ a! Y  Y2 u+ B$ x; ]. J
    End Sub1 s9 z, j* D! D# ~+ O' f) b6 ]! ]7 i
9 |( p- e1 q$ E0 y, u# `) J1 Z( x
    '------------------------------------------------------------------------------' A. u; D, S2 Z- ~
    'Method Name: Dispose3 X5 x) ]# f+ A( J7 @. z
    '------------------------------------------------------------------------------
2 W" e0 U; n8 Z5 M( d) ~& M% P    Public Sub Dispose()
+ z+ ]% R( N# o3 N' Y6 q! R1 x6 a        If theDialog IsNot Nothing Then
" g, e. F1 M/ f! `            theDialog.Dispose()
; m# J/ I  }4 L9 l) Y7 r            theDialog = Nothing
: E% V+ E$ l8 W: R8 p3 ^2 B        End If
, Z# N3 _# [3 x& x3 L, F8 _    End Sub& A+ R# t4 ?7 v* v2 B4 R/ F, N+ ?
7 w9 `. N, w0 Y. z
( n7 P3 B' S: [- j. }
    '------------------------------------------------------------------------------- w2 Q' }* p; w
    'Callback Name: initialize_cb
( o; ]. `9 a& |& F, }    '------------------------------------------------------------------------------
& Z1 q; o3 S% b0 L! O2 [$ J    Public Sub initialize_cb()
' ^, z" {0 u" g8 p) k        Try( P& H* K( r8 u3 _

  G7 z+ h7 [( G+ b7 k            group0 = CType(theDialog.TopBlock.FindBlock("group0"), NXOpen.BlockStyler.Group)1 |1 k$ G% g: N' r1 e0 N
            linear = CType(theDialog.TopBlock.FindBlock("linear"), NXOpen.BlockStyler.LinearDimension)7 T1 K% @5 c* m
            string01 = CType(theDialog.TopBlock.FindBlock("string01"), NXOpen.BlockStyler.StringBlock). F! Z: D1 ?+ h6 C
            string02 = CType(theDialog.TopBlock.FindBlock("string02"), NXOpen.BlockStyler.StringBlock)
2 v# f+ _5 A0 V) W- Z' C            string03 = CType(theDialog.TopBlock.FindBlock("string03"), NXOpen.BlockStyler.StringBlock)
; m/ v. T1 Z. e" ?+ W( J) ?$ q            string06 = CType(theDialog.TopBlock.FindBlock("string06"), NXOpen.BlockStyler.StringBlock)
4 y7 a3 p2 l# `            string04 = CType(theDialog.TopBlock.FindBlock("string04"), NXOpen.BlockStyler.StringBlock)" l7 B  ^' L$ @$ R. J( x' _
            string05 = CType(theDialog.TopBlock.FindBlock("string05"), NXOpen.BlockStyler.StringBlock)
! X2 ]( R0 ?9 q2 |0 W3 }1 U& V# J% A( Y            string07 = CType(theDialog.TopBlock.FindBlock("string07"), NXOpen.BlockStyler.StringBlock)5 N- R# W& @, F- Z, R
            string09 = CType(theDialog.TopBlock.FindBlock("string09"), NXOpen.BlockStyler.StringBlock)
  |/ i& D0 O3 s+ p/ D2 W- v            string010 = CType(theDialog.TopBlock.FindBlock("string010"), NXOpen.BlockStyler.StringBlock)! K) K0 U; s( d. e6 g% r
            string011 = CType(theDialog.TopBlock.FindBlock("string011"), NXOpen.BlockStyler.StringBlock)
: m0 N  E0 t' D5 x* h& j- I# g" M            string012 = CType(theDialog.TopBlock.FindBlock("string012"), NXOpen.BlockStyler.StringBlock)
/ V# S' v# E6 J* K, k! [2 K$ R            list_box0 = CType(theDialog.TopBlock.FindBlock("list_box0"), NXOpen.BlockStyler.ListBox)0 u4 o1 ^" v5 [( w; A; c

& e: O8 H+ U4 p" O1 ?3 _" u, A9 k. ~% Y& G

' f4 m5 Y$ ?: I3 ?# Q4 p        Catch ex As Exception: P; K: X4 v) \3 K7 O* q& @5 K% a
( l7 Q1 c' x  v, J; h
            theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString)
& [* ^' C4 d! g% e$ N        End Try1 b& d) t* d9 w
    End Sub! ?; U% h& M, h9 L

" P2 x# D! x* w    '------------------------------------------------------------------------------  P. p' b' M. e" `8 F! N  ~
    'Callback Name: dialogShown_cb; G$ p  e# U  J8 v, g, k2 y! }
    '------------------------------------------------------------------------------2 n9 {4 v0 f3 z4 [! o6 Y
    Public Sub dialogShown_cb()
+ r6 Q5 x. h3 X$ Y" g$ i0 d        Try
5 u! J4 c+ n1 G6 U
( @; x  |2 l! ^5 c( n7 \, g+ r* q$ q7 f! e5 Q
        Catch ex As Exception7 N9 `2 \  [  r( q0 |& f' y0 u
0 Z9 ~3 c; X$ V5 j4 k3 h
            theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString); j' I, Q, H# i
        End Try
; Z% R. x( n' R# t* A; |) G    End Sub
- Z, G: F8 v: z; S1 E( w6 O- \7 v
, X# k7 C6 Y3 W  G5 r' l    '------------------------------------------------------------------------------
$ i+ v- m9 U7 a) @    'Callback Name: apply_cb- i" ]: @! e- ~1 S) h& f
    '------------------------------------------------------------------------------
  \# u/ J7 d5 t    Public Function apply_cb() As Integer$ v& E. O4 x; ]5 [8 Q6 L$ R
        Dim errorCode As Integer = 0
) k$ |+ P# A" V6 ^        Try
9 s8 F4 t3 u9 h' g2 R
* y' r- {: K9 \
4 \# r4 d- ?3 W4 c/ C/ F* c% t        Catch ex As Exception% ]" ^( X3 u0 c) t' n
* H& R! d6 y0 w6 G" I, c
            errorCode = 1% a2 H: `0 a0 x! ~+ j" }; i
            theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString)# N+ J8 l3 F4 N6 r
        End Try5 I) s4 N+ ?3 }( A: J$ z5 v: t7 b) M
        apply_cb = errorCode
: |9 P9 n5 n5 l- b9 v9 ]" \    End Function
; M) G* P+ r: ~5 i1 B5 |& s2 G0 g1 R2 F! z( [1 c1 v# D) z
    '------------------------------------------------------------------------------
& q8 Z" ~0 i# Y1 X/ e! s$ o    'Callback Name: update_cb
  `1 [9 p' n, ^# o    '------------------------------------------------------------------------------8 S. ?2 G7 [, z$ H, N8 u
    Public Function update_cb(ByVal block As NXOpen.BlockStyler.UIBlock) As Integer
2 @, r& P: D" S5 D. k        Try: V; t1 Y( @1 P& z& Z& C, r9 P

9 m, F7 d9 w  ?# n            Dim num As Single = CType(linear.Value, Single) '转浮点数
  W$ H+ m6 c, |0 x. h: l& T            Dim aa3 As Decimal = Math.Round((num * string01.Value * string02.Value * 0.001), 3) '3位小数
: B5 \) P' u: y( V; B  F            string03.Value = aa3+ T& Z. S, }8 o
            Dim aa4 As Decimal = Math.Round((string03.Value * 0.8), 3) '3位小数
$ s6 y$ U0 }" h" M            string04.Value = aa4
' i( V+ q1 }& a4 w            Dim aa5 As Decimal = Math.Round((string04.Value * 1 / 6), 3) '3位小数
, ?/ g+ E' V+ @# \, w& ]4 A  M% E+ e            string05.Value = aa56 b6 l1 |4 w# B: n2 K" H& g
            Dim aa6 As Decimal = Math.Round((string03.Value * 0.06), 3) '3位小数7 S+ z+ k1 [) n8 Q, r' }$ S
            string06.Value = aa64 j4 P4 Y- X1 z! _
+ T; F( s% M6 `, x  L' }
            Dim a3 As Single = CType(string03.Value, Single) '转浮点数5 c$ X2 d" l7 Z8 D5 E
            Dim a4 As Single = CType(string04.Value, Single)
4 A6 r3 e4 m: C0 S            Dim a5 As Single = CType(string05.Value, Single)
9 G" A# ^$ y+ u7 S5 ^, }' G! Z            Dim a6 As Single = CType(string06.Value, Single)8 v* t, e% E+ M
% o( n" z8 W4 k: w
            Dim b3 As Decimal = Math.Round(a3, 3) '3位小数
$ A9 j$ v5 _! B/ }            Dim b4 As Decimal = Math.Round(a4, 3)
: {' a5 [: q' F  e            Dim b5 As Decimal = Math.Round(a5, 3); [" D& T* A: L7 K; i; ~& K
            Dim b6 As Decimal = Math.Round(a6, 3)
7 N) R. s5 r& b. A4 M( I- v
9 U. l5 b+ ]) s4 n3 H& _* K  F; G3 H4 r. a* f; D' s
            Dim d1 As Decimal = Math.Round((b3 * 1.3 + b6 * 1.3), 3) '2位小数+ k% n7 G* I+ r! s5 G6 P, Z! w
            Dim d2 As Decimal = Math.Round((b4 * 1.3 + b5 * 1.3), 3)
- P7 r/ f* C" B3 V7 {8 @+ b7 H6 F1 I; N
            string07.Value = d1
% y7 {& g- j; b* S: R/ J* m            string09.Value = d2
9 _; O9 P6 ?* B/ L/ B) Y3 F, S5 A0 a. o* U
6 K7 K; p- J, s3 B1 V  W# C
            Dim a As Single = CType(string010.Value, Single) '转浮点数
* o3 B7 k3 V2 U) {            Dim b As Single = CType(string011.Value, Single)
! M& h; Y  ~: p! g8 A( I            string012.Value = a + b: N2 i6 r5 V& W+ j

. U- Q- Q. x1 Y6 P- p- ^
, Y( a+ O; f4 a! J* W+ A9 K
4 J% B# l8 b) \( R7 r, x- E9 z4 y* U9 ?" ^* `2 d

' @" T" Z. g( N        Catch ex As Exception
+ q5 Q4 d9 k6 o0 e$ ^( M( r
# t1 w1 k4 ]. K/ T0 k5 @' ]3 L+ [7 [6 l            theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString). A# l$ J6 A- k9 k, o4 I8 l" E
        End Try
( E! w  f6 x7 ^/ I& J        update_cb = 0; ^; u. h5 O% [" ?* ~  l
    End Function
* v; x  D! f7 o" V1 q/ T! f# d4 u7 v9 `$ a7 c. h
    '------------------------------------------------------------------------------
2 Z, u5 W% H/ _7 w/ X    'Callback Name: ok_cb% ^: V! N* T' [* x
    '------------------------------------------------------------------------------! k7 y5 ~" S8 ?: \4 ~! ^* g. P
    Public Function ok_cb() As Integer) N' G0 N: g7 I" R/ z# [
        Dim errorCode As Integer = 0* O% H3 ^4 o( y; W: H/ G
        Try
$ w7 n0 H0 n- f  @+ Y* Q" ?& i3 Q  F$ g3 P) H
            errorCode = apply_cb()
0 G3 R9 G1 X5 G# O
+ f9 z# Y5 x9 v: J        Catch ex As Exception4 b/ u  H" J. x, s

7 ^# `5 Q. L& M( n6 v- i            errorCode = 1
# t% V# [' g0 e' {            theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString)% l! f: f6 a1 L( K
        End Try6 z! P; M6 F/ W8 a+ M5 ?
        ok_cb = errorCode' M( `4 i% J# Z7 n- f
    End Function( B2 ~9 x/ a) L! q8 \6 J/ j
- B! d- Y. K1 g2 f  T% |  N- \
    '------------------------------------------------------------------------------
0 W. z9 T4 [/ Q* D' g1 F    'Callback Name: enableOKButton_cb
: |$ G! K* l) y, `    '------------------------------------------------------------------------------0 D* M- f. w; K# T9 Q
    Public Function enableOKButton_cb() As Boolean
" J8 D. I0 U+ E3 N+ b% K+ g        enableOKButton_cb = True
& G8 O6 i% A' X) D/ y, j% C  Z        Try
9 }0 S, {- `- }* o7 R
* [+ Q5 F& i' h* G5 k( Q. _
  b6 G: ^: M* J% P$ g        Catch ex As Exception% O0 L: S, s% V7 N& w4 T
8 K; B& t+ Q! c/ M) k2 Z
            theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString)
& u/ y# D/ q0 \) Y) Q        End Try- _+ V, u0 B8 d" C. w3 c
    End Function
% p  u- U' }* ?" `7 \) N" V4 O
* R0 T: U8 g: d6 r* O3 m
/ |/ G2 g% B4 A$ t8 g3 ]* j
4 j" `% }. j. Y' j6 X* B9 _6 ~9 r    '------------------------------------------------------------------------------7 ~3 A: J- T' G" I6 a
    'Function Name: GetBlockProperties
# Q  o* l" W; v: H# M    'Returns the propertylist of the specified BlockID
( L/ R+ u9 P( k3 W7 N- M    '------------------------------------------------------------------------------$ `) T* J3 s: ]$ z, d8 a2 ^
    Public Function GetBlockProperties(ByVal blockID As String) As PropertyList
4 D+ s) v- b8 i        GetBlockProperties = Nothing1 T: }  u9 ~. \4 V3 n9 O
        Try$ a9 v4 I8 ], v9 A1 z
7 Q3 O' u) [7 x
            GetBlockProperties = theDialog.GetBlockProperties(blockID)7 E9 {. X, \! s
( ^( h. b! J8 _. M6 S" V. i
        Catch ex As Exception
" W8 h  L  H+ q# E6 f# {6 t- }( M4 o5 l! Z
            theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString)
1 ^) Q3 x6 a7 B* u        End Try
& q# R9 n/ a; l1 {8 ]' h; b- o4 M    End Function, l* z' d8 f) U$ n, h
+ m  L; a4 N; s, S9 L
End Class# d) ~, W6 R3 n# I4 t. e
% y6 A- ~( B  w' G% I
' V7 @$ i! q* L+ o7 ?
press.JPG
1.JPG

press.rar

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

源码

发表于 2022-9-11 21:41 | 显示全部楼层
       string07.Value = d1
0 Z* m' G1 L* G1 {: ^) }. I4 P  O        string09.Value = d2) m0 y( z: ?; N/ V, _1 Q
不报错吗?
回复 支持 反对

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-7-3 14:57 , Processed in 0.161208 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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