CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

AutoCAD 2024 开发者帮助

DefaultInternetURL 属性 (ActiveX)

2024-5-18 19:08| 发布者: admin| 查看: 83| 评论: 0|原作者: admin|来自: AutoCAD

DefaultInternetURL 属性 (ActiveX)

指定默认 Internet 地址。

支持的平台:仅限 Windows

签名

VBA:

object.DefaultInternetURL
对象

类型:PreferencesFiles

此属性应用于的对象。

属性值

只读:

类型:字符串

默认 Internet 地址。

言论

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

例子

VBA:

Sub Example_DefaultInternetURL()
    ' This example returns the current setting of
    ' DefaultInternetURL. It then changes the value, and finally
    ' it resets the value back to the original setting.
    
    Dim preferences As AcadPreferences
    Dim currDefaultInternetURL As String
    Dim newDefaultInternetURL As String
    
    Set preferences = ThisDrawing.Application.preferences
    
    ' Retrieve the current DefaultInternetURL value
    currDefaultInternetURL = preferences.Files.DefaultInternetURL
    MsgBox "The current value for DefaultInternetURL is " & currDefaultInternetURL, vbInformation, "DefaultInternetURL Example"
    
    ' Change the value for DefaultInternetURL
    newDefaultInternetURL = "TestDefaultInternetURL"
    preferences.Files.DefaultInternetURL = newDefaultInternetURL
    MsgBox "The new value for DefaultInternetURL is " & newDefaultInternetURL, vbInformation, "DefaultInternetURL Example"
    
    ' Reset DefaultInternetURL to its original value
    preferences.Files.DefaultInternetURL = currDefaultInternetURL
    MsgBox "The DefaultInternetURL value is reset to " & currDefaultInternetURL, vbInformation, "DefaultInternetURL Example"
End Sub

可视化 LISP:

(vl-load-com)
(defun c:Example_DefaultInternetURL()
    ;; This example returns the current setting of
    ;; DefaultInternetURL. It then changes the value, and finally
    ;; it resets the value back to the original setting.
    (setq acadObj (vlax-get-acad-object))
    (setq preferences (vla-get-Preferences acadObj))
  
    ;; Retrieve the current DefaultInternetURL value
    (setq currDefaultInternetURL (vla-get-DefaultInternetURL (vla-get-Files preferences)))
    (alert (strcat "The current value for DefaultInternetURL is " currDefaultInternetURL))
    
    ;; Change the value for DefaultInternetURL
    (setq newDefaultInternetURL "TestDefaultInternetURL")
    (vla-put-DefaultInternetURL (vla-get-Files preferences) newDefaultInternetURL)
    (alert (strcat "The new value for DefaultInternetURL is " newDefaultInternetURL))
    
    ;; Reset DefaultInternetURL to its original value
    (vla-put-DefaultInternetURL (vla-get-Files preferences) currDefaultInternetURL)
    (alert (strcat "The DefaultInternetURL value is reset to " currDefaultInternetURL))
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-12-15 11:26

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部