|
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区
您需要 登录 才可以下载或查看,没有账号?立即注册
×
Mastercam X7已经可以达到如UG后处理一样直接取得电脑用户,而且其参数和使用方法特别简单,该功能只能适用于MastercamX7以后的版本,之前的版本没有这个函数。! M) s3 k; S. {$ } i7 E
下面给大家分享这个大家梦寐以求的功能及代码,使用方法。2 j# I; b1 a6 T5 ^* d5 j
1.首先定义一个用户变量(必须是字符串类型)5 G1 ]1 V% q" L
susername : ""
5 f6 g/ q: D9 M2 ]9 V5 ]5 r2.也是最关键的,同时也是X7新加入的一个功能性的参数。
: j" H5 u" a9 H' K susername = sysinfo(result, 3)
* b' [$ g8 K" b2 t( _% @$ n3.在需要输出的位置调用即可。
: u, I1 ~5 F0 a0 J
3 I0 u* G& v- H- x& b, o9 b( Y下面是mastercamX7官方后处理新增加的变量使用说明:* ^7 |1 u5 d7 s8 x. }/ c
In X7, we have a new function to get this information.
/ J9 }& y3 i; N/ k$ n4 U( l& j% i; v7 u! \) w4 c
str1 = sysinfo(*val1, val2)' e/ l- e U" X" @7 o
$ ]2 s0 M! y& m% E& d
val1 = return 0 on failure, 1 if success# ?& y+ E4 m& B+ U! p; ^
val2 = option for function (mode)
* A. |) r2 O9 z$ fstr1 = return string based on val22 k0 f# F. u, O
Option 0 = NameUnknown - An unknown name type, really
! Y% f' }9 Z' G$ R+ Z0 v$ G1 x4 n+ X2 z$ C- `" t
Option 1 = NameFullyQualifiedDN - The fully-qualified distinguished name (for example, CN=Jeff Smith,OU=Users,DC=Engineering,DC=Microsoft,DC=Com)( \; p- q9 }! r0 R% s7 b! [
5 ~/ i( n3 z" F, j4 W) `
Option 2 = NameSamCompatible - A legacy account name (for example, Engineering\JSmith). The domain-only version includes trailing backslashes (\\)# s9 ~" g, ^, h9 e! B9 R$ F
" C$ P1 K0 M; p" `) o# }Option 3 = NameDisplay - A "friendly" display name (for example, Jeff Smith). The display name is not necessarily the defining relative distinguished name (RDN)
. k( Z) Z4 X6 l% w) \, { d2 h
' T: c4 D* B1 D3 z" @$ IOption 4 = NameUniqueId - A GUID string that the IIDFromString function returns (for example, {4fa050f0-f561-11cf-bdd9-00aa003a77b6})
~( O7 d6 G$ o/ k m2 C+ j1 w! F8 O' @3 P- }# [0 T, V5 e; _; Q
Option 5 = NameCanonical - The complete canonical name (for example, engineering.microsoft.com/software/someone). The domain-only version includes a trailing forward slash (/)
2 Q8 K1 \ H2 }1 g! `% ^" w& X1 r d9 K- V9 W
Option 6 = NameUserPrincipal - The user principal name (for example, someone@example.com)
* W% {7 s0 N) c0 s- `$ T$ Q# T" ], K( j1 u+ u4 Y
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)
0 C% j- @6 ^4 W7 G7 G2 L ?
$ k0 R2 }9 B" c0 h2 W1 @' q$ eOption 8 = NameServicePrincipal - The generalized service principal name (for example, www/www.microsoft.com@microsoft.com)8 u3 M6 b, N7 p$ _
; u b! r& q( G$ V
Option 9 = NameDnsDomain - The DNS domain name followed by a backward-slash and the SAM user name |
|