AutoLISP programs commonly require very few changes in order to run on the latest release.
However, an AutoLISP program might no longer run correctly on the latest release because an AutoLISP function, or AutoCAD-based product command or system variable has been changed or deprecated.
Review your custom programs for commands and system variables that have been designated as obsolete. In some cases, an obsolete command or system variable can still be used by your custom programs even though it cannot be entered directly at the Command prompt or accessed from the user interface.
The following techniques might be useful in trying to use an obsolete command or system variable in a custom program:
Starting with AutoCAD 2017-based products, the values stored in the CDATE and DATE system variables no longer represent the current date\time down to the nearest millisecond or one-hundredth of a second. Seconds are now the smallest unit of time in which the values of these two system variables are expressed. If you need to track time intervals smaller than one second, consider using the value returned by the MILLISECS system variable which stores the difference in time since the workstation was booted in milliseconds.
The following date\time related system variables were also affected by the removal of milliseconds:
If any of your existing programs require time differences down to the nearest millisecond, you could obtain the last 2 or 3 digits of the value stored in the MILLISECS system variable and append them to the value returned by the CDATE system variable which would produce a value comparable to that returned by the CDATE system variable in AutoCAD 2016-based products and earlier. The following code sample shows how you might go about getting a date\time value that includes milliseconds based on the target AutoCAD release:
; Returns a CDATE value that includes milliseconds based on release
; Usage: (CDate)
; Replaces (rtos (getvar "CDATE") 2 8)
(defun CDate ( / ms)
; Check to see which AutoCAD release is being used
(if (<= (atof (getvar "ACADVER")) 22.0)
(rtos (getvar "CDATE") 2 8)
(progn
; Get the current milliseconds and append it to the CDATE value
(setq ms (itoa (getvar "MILLISECS")))
(strcat (rtos (getvar "CDATE") 2 6)(substr ms (- (strlen ms) 2)))
)
)
)
Starting with AutoCAD 2017-based products, the EPDFSHX system variable introduced with AutoCAD 2016 Update 1 has been renamed to PDFSHX. As a result of the name change, any AutoLISP statements that reference the EPDFSHX system variable must be revised. These are the functions to most likely be impacted by this change in your custom programs:
Starting with AutoCAD 2016-based products, AutoLISP files can be digitally signed. Digitally signing an AutoLISP file allows it to be loaded into the AutoCAD drawing environment without warning the user that the file isn't trusted. VLX files that are digitally signed cannot be loaded into AutoCAD 2015-based or earlier products.
Starting with AutoCAD 2016-based products, the osnap function no longer supports the Quick (qui) Object Snap mode. Remove the qui mode from the statements that use the osnap functions in your AutoLISP programs. If the mode is not removed, the osnap function returns nil instead of a coordinate value for a valid point in the drawing area.