确定在设计中心中对未指定插入单位的目标图形的对象自动使用的单位。 支持的平台:仅窗口 属性值只读:不 类型:枚举acInsertUnits
言论此属性的初始值为。acInsertUnitsUnitless 注意:此属性的值存储在 INSUNITSDEFTARGET 系统变量中。
例子工 务 局: Sub Example_ADCInsertUnitsDefaultTarget() ' This example reads and modifies the ADCInsertUnitsDefaultTarget ' preference value. ' When finished, this example resets the preference value back to ' its original value. Dim ACADPref As AcadPreferencesUser Dim originalValue As Integer, newValue As Integer ' Get the user preferences object Set ACADPref = ThisDrawing.Application.preferences.User ' Read and display the original value originalValue = ACADPref.ADCInsertUnitsDefaultTarget MsgBox "The ADCInsertUnitsDefaultTarget preference is set to: " & originalValue ' Modify the ADCInsertUnitsDefaultTarget preference by toggling the value ACADPref.ADCInsertUnitsDefaultTarget = acInsertUnitsMillimeters MsgBox "The ADCInsertUnitsDefaultTarget preference has been set to: " & ACADPref.ADCInsertUnitsDefaultTarget ' Reset the preference back to its original value ACADPref.ADCInsertUnitsDefaultTarget = originalValue MsgBox "The ADCInsertUnitsDefaultTarget preference was reset back to: " & originalValue End Sub Visual LISP: (vl-load-com) (defun c:Example_ADCInsertUnitsDefaultTarget() ;; This example reads and modifies the ADCInsertUnitsDefaultTarget ;; preference value. ;; When finished, this example resets the preference value back to ;; its original value. (setq acadObj (vlax-get-acad-object)) ;; Get the user preferences object (setq pref (vla-get-Preferences acadObj)) (setq user (vla-get-User pref)) ;; Read and display the original value (setq originalValue (vla-get-ADCInsertUnitsDefaultTarget user)) (alert (strcat "The ADCInsertUnitsDefaultTarget preference is set to: " (itoa originalValue))) ;; Modify the ADCInsertUnitsDefaultTarget preference by toggling the value (vla-put-ADCInsertUnitsDefaultTarget user acInsertUnitsMillimeters) (alert (strcat "The ADCInsertUnitsDefaultTarget preference has been set to: " (itoa (vla-get-ADCInsertUnitsDefaultTarget user)))) ;; Restore the preference back to its original value (vla-put-ADCInsertUnitsDefaultTarget user originalValue) (alert (strcat "The ADCInsertUnitsDefaultTarget preference was restored back to: " (itoa originalValue))) ) |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-1-8 19:50
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.