|
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区
您需要 登录 才可以下载或查看,没有账号?立即注册
×
Mastercam X7已经可以达到如UG后处理一样直接取得电脑用户,而且其参数和使用方法特别简单,下面给大家分享这个大家梦寐以求的功能及代码,使用方法。
7 {/ N u: S. R% M1.首先定义一个用户变量(必须是字符串类型)
" U/ ?: i E1 g# Bsusername : ""
% y1 O9 \* \, w3 L$ R! x2.也是最关键的,同时也是X7新加入的一个功能性的参数。
9 X5 i! `: p( V susername = sysinfo(result, 3)9 Z6 w: H0 [3 N" w) v, y" a1 x
3.在需要输出的位置调用即可。( Z$ y4 W* o2 I6 d% h
- A, n9 i" N' f, T2 c
下面是mastercamX7官方后处理新增加的变量使用说明:( q, w* d9 S0 b1 S/ B, M
In X7, we have a new function to get this information.
- [5 D' B9 E+ S; ^- k# D; f
6 z) Q0 }; G8 |6 L4 W( N _' ]str1 = sysinfo(*val1, val2)% n8 L! [5 J) z, j
' f8 N1 l, L' Eval1 = return 0 on failure, 1 if success! T5 H' H4 y# m) j
val2 = option for function (mode)
/ R/ x6 k6 q) P: [' Zstr1 = return string based on val20 I3 u3 q+ R- b: y0 V7 O, \# k
Option 0 = NameUnknown - An unknown name type, really
( `/ H. ]4 P+ I6 [% @$ I, ^: ^) V& o) A0 d
Option 1 = NameFullyQualifiedDN - The fully-qualified distinguished name (for example, CN=Jeff Smith,OU=Users,DC=Engineering,DC=Microsoft,DC=Com)
5 {* l$ U1 J0 Q1 p4 L/ K4 V, A7 `4 E4 z n) g
Option 2 = NameSamCompatible - A legacy account name (for example, Engineering\JSmith). The domain-only version includes trailing backslashes (\\)9 P+ }) \, t* I$ R/ N
7 @% c/ ]1 z2 ]! R% jOption 3 = NameDisplay - A "friendly" display name (for example, Jeff Smith). The display name is not necessarily the defining relative distinguished name (RDN)8 v/ Y- X9 j& O4 w I9 j
. ~4 Y7 }* y( \Option 4 = NameUniqueId - A GUID string that the IIDFromString function returns (for example, {4fa050f0-f561-11cf-bdd9-00aa003a77b6})
6 a5 G# {9 V8 r! K/ R7 h8 X' s t D2 Y! n. u$ l# {
Option 5 = NameCanonical - The complete canonical name (for example, engineering.microsoft.com/software/someone). The domain-only version includes a trailing forward slash (/)
4 r( V4 e8 ^. R2 }" ]2 x
5 Q* F& v' W& W `# b; |1 S2 qOption 6 = NameUserPrincipal - The user principal name (for example, someone@example.com)
- ^4 w4 X h, K6 K. V( M% x! q1 x- k0 w9 T7 Y8 `/ |8 b
Option 7 = NameCanonicalEx - The same as NameCanonical except that the rightmost forward slash (/) is replaced with a new line character (\n), even in a domain-only case (for example, engineering.microsoft.com/software\nJSmith)5 W/ I/ }/ k( d+ w, y
( M$ s. e8 ]$ v4 \' {1 Q& g
Option 8 = NameServicePrincipal - The generalized service principal name (for example, www/www.microsoft.com@microsoft.com)" {- N* A. i8 s& d* `
0 n' u$ a1 H5 ]% K
Option 9 = NameDnsDomain - The DNS domain name followed by a backward-slash and the SAM user name |
|