CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

ADCInsertUnitsDefaultSource Property (ActiveX)

2023-1-3 23:50| 发布者: admin| 查看: 759| 评论: 0|来自: AutoCAD

摘要: 确定在设计中心中对未指定插入单位的源图形的对象自动使用的单位。

确定在设计中心中对未指定插入单位的源图形的对象自动使用的单位。

支持的平台:仅窗口

签名

工 务 局:

object.ADCInsertUnitsDefaultSource
对象

类型:首选项用户

此属性适用的对象。

属性值

只读:

类型:枚举acInsertUnits

  • acInsertUnitsAngstroms
  • acInsertUnitsAstronomicalUnits
  • acInsertUnitsCentimeters
  • acInsertUnitsDecameters
  • acInsertUnitsDecimeters
  • acInsertUnitsFeet
  • acInsertUnitsGigameters
  • acInsertUnitsHectometers
  • acInsertUnitsInches
  • acInsertUnitsKilometers
  • acInsertUnitsLightYears
  • acInsertUnitsMeters
  • acInsertUnitsMicroinches
  • acInsertUnitsMicrons
  • acInsertUnitsMiles
  • acInsertUnitsMillimeters
  • acInsertUnitsMils
  • acInsertUnitsNanometers
  • acInsertUnitsParsecs
  • acInsertUnitsUnitless
  • acInsertUnitsUSSurveyFeet
  • acInsertUnitsUSSurveyInch
  • acInsertUnitsUSSurveyMile
  • acInsertUnitsUSSurveyYard
  • acInsertUnitsYards

言论

此属性的初始值为。acInsertUnitsUnitless

注意:此属性的值存储在 INSUNITSDEFSOURCE 系统变量中。

例子

工 务 局:

Sub Example_ADCInsertUnitsDefaultSource()
    ' This example reads and modifies the ADCInsertUnitsDefaultSource
    ' 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.ADCInsertUnitsDefaultSource
    MsgBox "The ADCInsertUnitsDefaultSource preference is set to: " & originalValue

    ' Modify the ADCInsertUnitsDefaultSource preference by toggling the value
    ACADPref.ADCInsertUnitsDefaultSource = acInsertUnitsMillimeters

    MsgBox "The ADCInsertUnitsDefaultSource preference has been set to: " & ACADPref.ADCInsertUnitsDefaultSource

    ' Reset the preference back to its original value
    ACADPref.ADCInsertUnitsDefaultSource = originalValue
    MsgBox "The ADCInsertUnitsDefaultSource preference was reset back to: " & originalValue
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_ADCInsertUnitsDefaultSource()
    ;; This example reads and modifies the ADCInsertUnitsDefaultSource
    ;; 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-ADCInsertUnitsDefaultSource user))
    (alert (strcat "The ADCInsertUnitsDefaultSource preference is set to: " (itoa originalValue)))

    ;; Modify the ADCInsertUnitsDefaultSource preference by toggling the value
    (vla-put-ADCInsertUnitsDefaultSource user acInsertUnitsMillimeters)
    (alert (strcat "The ADCInsertUnitsDefaultSource preference has been set to: " (itoa (vla-get-ADCInsertUnitsDefaultSource user))))

    ;; Restore the preference back to its original value
    (vla-put-ADCInsertUnitsDefaultSource user originalValue)
    (alert (strcat "The ADCInsertUnitsDefaultSource preference was restored back to: " (itoa originalValue)))
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

QQ|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 )

GMT+8, 2024-5-11 22:00

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部