図面で実行するセキュリティ関連操作を指定します。
サポートされているプラットフォーム: Windows のみ
読み込み専用: いいえ
タイプ: 長整数型; AcadSecurityParamsType 列挙型
図面暗号化、図面プロパティの暗号化、デジタル署名、タイム スタンプに関する以下の定数を 1 つまたは複数指定します。
各定数はセキュリティ関連操作を表します。Action プロパティを使用するとき、一連の操作のある時点で、Action プロパティを定数 ACADSECURITYPARAMS_ENCRYPT_DATA、定数 ACADSECURITYPARAMS_SIGN_DATA、またはその両方に設定する必要があります。
複数のセキュリティ関連操作を指定するには、それらの操作を表す定数を追加します。たとえば、図面に署名し、タイムスタンプを使用するには、以下のように指定します。
ACADSECURITYPARAMS_SIGN_DATA + ACADSECURITYPARAMS_ADD_TIMESTAMP
VBA:
Sub Example_Action()
' This example encrypts and saves a file.
Dim sp As AcadSecurityParams
Set sp = GetInterfaceObject("AutoCAD.SecurityParams.20")
sp.Action = AcadSecurityParamsType.ACADSECURITYPARAMS_ENCRYPT_DATA
sp.Algorithm = AcadSecurityParamsConstants.ACADSECURITYPARAMS_ALGID_RC4
sp.KeyLength = 40
sp.Password = UCase("mypassword") 'AutoCAD converts all passwords to uppercase before applying them
sp.ProviderName = "Microsoft Base Cryptographic Provider v1.0"
sp.ProviderType = 1
ThisDrawing.SaveAs "C:\MyDrawing.dwg", , sp
End Sub
Visual LISP:
(vl-load-com)
(defun c:Example_Action()
;; This example encrypts and saves a drawing file.
(setq acadObj (vlax-get-acad-object))
(setq sp (vlax-create-object "AutoCAD.SecurityParams.20"))
(vla-put-Visible acadObj :vlax-true)
(vla-put-Action sp ACADSECURITYPARAMS_ENCRYPT_DATA)
(vla-put-Algorithm sp ACADSECURITYPARAMS_ALGID_RC4)
(vla-put-KeyLength sp 40)
(vla-put-Password sp (strcase "mypassword"))
(vla-put-ProviderName sp "Microsoft Base Cryptographic Provider v1.0")
(vla-put-ProviderType sp 1)
(setq doc (vla-get-ActiveDocument acadObj))
(vla-SaveAs doc "C:\\MyDrawing.dwg" acNative sp)
(vlax-release-object sp)
)