AllowLongSymbolNames Property (ActiveX)

Determines if symbol names may include extended character sets, or more than 31 characters.

Supported platforms: Windows only

Signature

VBA:

object.AllowLongSymbolNames
object

Type: DatabasePreferences

The object this property applies to.

Property Value

Read-only: No

Type: Boolean

Remarks

The initial value of this property is True.

Extended symbol names may contain up to 255 characters and A-Z, 0-9, spaces, and any special character not used by Microsoft Windows and AutoCAD for other purposes.

Restricted symbol names may contain up to 31 characters and A-Z, 0-9, dollar sign ($), underscore (_), and hyphen (-).

This property applies to the names of non-graphical objects (such as linetypes and layers) that are stored in symbol tables.

Note: The value of this property is stored in the EXTNAMES system variable.

Examples

VBA:

Sub Example_AllowLongSymbolNames()
    ' This example reads and modifies the preference value that controls
    ' whether symbol names include extended character sets or more
    ' than 31 characters.
    '
    ' When finished, this example resets the preference value back to
    ' its original value.
    
    Dim ACADPref As AcadDatabasePreferences
    Dim originalValue As Variant, newValue As Variant
    
    ' Get the user preferences object
    Set ACADPref = ThisDrawing.preferences
    
    ' Read and display the original value
    originalValue = ACADPref.AllowLongSymbolNames
    MsgBox "The AllowLongSymbolNames preference is set to: " & originalValue

    ' Modify the AllowLongSymbolNames preference by toggling the value
    ACADPref.AllowLongSymbolNames = Not (ACADPref.AllowLongSymbolNames)
    newValue = ACADPref.AllowLongSymbolNames
    MsgBox "The AllowLongSymbolNames preference has been set to: " & newValue

    ' Reset the preference back to its original value
    '
    ' * Note: Comment out this last section to leave the change to
    '         this preference in effect
    ACADPref.AllowLongSymbolNames = originalValue
    MsgBox "The AllowLongSymbolNames preference was reset back to: " & originalValue
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_AllowLongSymbolNames()
    ;; This example reads and modifies the preference value that controls
    ;; whether symbol names include extended character sets or more
    ;; than 31 characters.
    ;;
    ;; When finished, this example resets the preference value back to
    ;; its original value.
    (setq acadObj (vlax-get-acad-object))

    ;; Get the drafting preferences object
    (setq ACADPref (vla-get-Preferences doc))
        
    ;; Read and display the original value
    (setq originalValue (vla-get-AllowLongSymbolNames ACADPref))
    (alert (strcat "The AllowLongSymbolNames preference is set to: " (if (= originalValue :vlax-true) "1" "0")))

    ;; Modify the AllowLongSymbolNames preference by toggling the value
    (vla-put-AllowLongSymbolNames ACADPref (if (= originalValue :vlax-true) :vlax-false :vlax-true))
    (setq newValue (vla-get-AllowLongSymbolNames ACADPref))
    (alert (strcat "The AllowLongSymbolNames preference has been set to: " (if (= newValue :vlax-true) "1" "0")))

    ;; Reset the preference back to its original value
    ;;
    ;; * Note: Comment out this last section to leave the change to
    ;;         this preference in effect
    (vla-put-AllowLongSymbolNames ACADPref originalValue)
    (alert (strcat "The AllowLongSymbolNames preference was reset back to: " (if (= originalValue :vlax-true) "1" "0")))
)