CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

AltFontFile Property (ActiveX)

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

摘要: 指定在 AutoCAD 无法找到原始字体且字体映射文件中未指定备用字体时要使用的字体文件的位置。

指定在 AutoCAD 无法找到原始字体且字体映射文件中未指定备用字体时要使用的字体文件的位置。

支持的平台:仅窗口

签名

工 务 局:

object.AltFontFile
对象

类型:首选项文件

此属性适用的对象。

属性值

只读:

类型:字符串

备用字体文件。

言论

没有额外的评论。

例子

工 务 局:

Sub Example_AltFontFile()
    ' This example returns the current setting of
    ' AltFontFile. It then changes the value, and finally
    ' it resets the value back to the original setting.
    
    Dim preferences As AcadPreferences
    Dim currAltFontFile As String
    Dim newAltFontFile As String
    
    Set preferences = ThisDrawing.Application.preferences
    
    ' Retrieve the current AltFontFile value
    currAltFontFile = preferences.Files.AltFontFile
    MsgBox "The current value for AltFontFile is " & currAltFontFile, vbInformation, "AltFontFile Example"
    
    ' Change the value for AltFontFile
    newAltFontFile = "C:/AutoCAD/Fonts/gothice.shx"
    preferences.Files.AltFontFile = newAltFontFile
    MsgBox "The new value for AltFontFile is " & newAltFontFile, vbInformation, "AltFontFile Example"
    
    ' Reset AltFontFile to its original value
    preferences.Files.AltFontFile = currAltFontFile
    MsgBox "The AltFontFile value is reset to " & currAltFontFile, vbInformation, "AltFontFile Example"
 End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_AltFontFile()
    ;; This example returns the current setting of
    ;; AltFontFile. 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))
    (setq files (vla-get-Files preferences))
      
    ;; Retrieve the current AltFontFile value
    (setq currAltFontFile (vla-get-AltFontFile files))
    (alert (strcat "The current value for AltFontFile is " currAltFontFile))
    
    ;; Change the value for AltFontFile
    (setq newAltFontFile "C:/AutoCAD/Fonts/gothice.shx")
    (vla-put-AltFontFile files newAltFontFile)
    (alert (strcat "The new value for AltFontFile is " newAltFontFile))
    
    ;; Reset AltFontFile to its original value
    (vla-put-AltFontFile files currAltFontFile)
    (alert (strcat "The AltFontFile value is reset to " currAltFontFile))
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-5-11 17:52

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部