|
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区
您需要 登录 才可以下载或查看,没有账号?立即注册
×
Mastercam X7已经可以达到如UG后处理一样直接取得电脑用户,而且其参数和使用方法特别简单,下面给大家分享这个大家梦寐以求的功能及代码,使用方法。; \+ [' k: y0 K! k1 f# X
1.首先定义一个用户变量(必须是字符串类型)
8 |- W; U/ x- V) isusername : ""
) x L( Q3 i2 b" w. H' V6 h8 E2.也是最关键的,同时也是X7新加入的一个功能性的参数。
9 z1 h0 ]9 t5 C% `' w; z, w susername = sysinfo(result, 3)
2 t6 x6 p7 t$ k7 E; d3.在需要输出的位置调用即可。1 U' ]6 \! ]7 k. u2 M
8 P* n1 N" B. w% i& Y( L1 L
下面是mastercamX7官方后处理新增加的变量使用说明:
, `6 ~3 ~8 u$ x' d. _, K" uIn X7, we have a new function to get this information.
5 m6 N" |2 o8 |, Y4 ?3 s0 C3 J! L+ k( z" }: e9 ~0 h& A
str1 = sysinfo(*val1, val2)& Q* b- S% Y u! w0 R, _
* |" s3 M$ L2 f2 u
val1 = return 0 on failure, 1 if success
. S3 }: a& T0 Yval2 = option for function (mode)/ r" y7 \$ ]- ?4 _# A
str1 = return string based on val28 J/ W( k; W8 S. W0 g
Option 0 = NameUnknown - An unknown name type, really& ^, `0 U/ ?4 a/ J. ]5 Z
% j* x( x* m$ U4 e) v
Option 1 = NameFullyQualifiedDN - The fully-qualified distinguished name (for example, CN=Jeff Smith,OU=Users,DC=Engineering,DC=Microsoft,DC=Com)
* E9 \* ]5 f( `% @6 x4 I3 P1 w* y$ A+ o* H- ]
Option 2 = NameSamCompatible - A legacy account name (for example, Engineering\JSmith). The domain-only version includes trailing backslashes (\\)
( [% j# D6 E: b) G7 v- z8 f: K; g9 v9 K# i. r- K6 J% c
Option 3 = NameDisplay - A "friendly" display name (for example, Jeff Smith). The display name is not necessarily the defining relative distinguished name (RDN)/ c( `: n' Z# h8 R9 w+ d5 C
+ s. X+ R, O Y- e0 D4 `# |; QOption 4 = NameUniqueId - A GUID string that the IIDFromString function returns (for example, {4fa050f0-f561-11cf-bdd9-00aa003a77b6})) k- B5 q% W1 D# X; y H( Q
* C0 W7 d1 N( X/ c& c8 X1 b
Option 5 = NameCanonical - The complete canonical name (for example, engineering.microsoft.com/software/someone). The domain-only version includes a trailing forward slash (/)$ [. q* f7 s2 g) _$ ?: S
, N" i( F7 q9 {. I
Option 6 = NameUserPrincipal - The user principal name (for example, someone@example.com)
( q$ ]6 l) R0 [ [
( X/ g3 j- p1 nOption 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)$ |" G* F4 s# }' Z1 V7 n; X
0 N4 F/ i# P l R$ s2 ?; tOption 8 = NameServicePrincipal - The generalized service principal name (for example, www/www.microsoft.com@microsoft.com)3 @% r# L. Z! @2 d: ]4 J
& U4 c3 @# e% ]: e: C7 YOption 9 = NameDnsDomain - The DNS domain name followed by a backward-slash and the SAM user name |
|