Doslib For Autocad 2016 12: A Powerful Tool for CAD Programmers
If you are a CAD programmer who uses AutoCAD or BricsCAD, you may have heard of Doslib, a library of LISP-callable functions that provide functionality not available in the native LISP interpreters of these applications. But what exactly is Doslib and how can it help you with your CAD projects? In this article, we will explain what Doslib is, what it can do, and how to install and use it for AutoCAD 2016 12 and other versions.
Doslib For Autocad 2016 12
Download
https://t.co/738RZCXo1n
What is Doslib?
Doslib is a library of LISP-callable functions that extend the LISP programming languages in AutoCAD and BricsCAD by providing the following functionality:
Drives - Check for drives, change between drives, and check available disk space.
Paths - Manipulate path specifications.
Folders - Create, rename, remove, select, and change folders. Return special operating system folders.
Files - Copy, delete, move, rename, and select files; get directory listings, search and find multiple instances of files, and change file attributes.
Print - Get and set default printers, and spool print files.
Configuration - Manipulate Windows-style initialization (INI) files, and access the Windows Registry.
Processes - Run operating system commands or other programs.
Interface - Get strings, integers, reals, and lists from the user. Display Windows message boxes, progress meters, and splash screens.
Strings - Tokenize strings, extract characters, find characters, insert, remove, and replace characters, and trim characters.
Math - Trigonometric calculations, vector manipulation, statistical analysis, and more.
CAD - Save all and close all open files. Preview drawings and list xrefs.
System - Get system information, sort lists, change the system date and time, manipulate the keyboard, and play sounds.
More!
Doslib is open-source and can be viewed on GitHub. It supports AutoCAD 2013 through 2022 and BricsCAD Pro V13 through V23.
How to Install Doslib for AutoCAD 2016 12?
To install Doslib for AutoCAD 2016 12, you need to download the appropriate version of Doslib from the official website. You can choose between a zip file or an installer file. The zip file contains the Doslib ARX file (doslib20.arx) and a sample LISP file (doslib.lsp) that loads the ARX file. The installer file contains the same files plus an uninstaller program.
If you download the zip file, you need to extract the files to a folder of your choice. Then you need to load the doslib.lsp file in AutoCAD using the APPLOAD command. This will load the doslib20.arx file automatically. You can also add the doslib.lsp file to your startup suite so that it loads every time you start AutoCAD.
If you download the installer file, you need to run it and follow the instructions. The installer will copy the doslib20.arx file to your AutoCAD support folder and add it to your trusted locations. It will also create a shortcut on your desktop that will load the doslib.lsp file in AutoCAD. You can use this shortcut to start AutoCAD with Doslib loaded or you can add the doslib.lsp file to your startup suite as explained above.
How to Use Doslib for AutoCAD 2016 12?
To use Doslib for AutoCAD 2016 12, you need to call its functions from your LISP programs or from the command line. The functions are prefixed with DOS_ followed by their name. For example, to get a list of drives on your computer, you can use the DOS_DRIVES function:
(DOS_DRIVES)
This will return a list of drive letters such as:
("A:" "C:" "D:" "E:")
You can also use optional arguments to modify the behavior of some functions. For example, to get a list of drives with their labels and free space in megabytes, you can use:
(DOS_DRIVES T T)
This will return a list of lists such as:
(("A:" "FLOPPY" NIL) ("C:" "SYSTEM" 12345) ("D:" "DATA" 67890) ("E:" "DVD" NIL))
You can find more information about each function in the documentation that comes with Doslib or on its website. You can also use the DOS_HELP function to display a brief description of any function:
(DOS_HELP DOS_DRIVES)
This will display something like:
DOS_DRIVES [show-labels] [show-free-space] Returns a list of drive letters available on this computer.
Optional arguments:
show-labels: If T then include drive labels.
show-free-space: If T then include free space in megabytes.
Example: (dos_drives t t)
Conclusion
Doslib is a powerful tool for CAD programmers who want to enhance their LISP programming capabilities with functions that are not available in the native LISP interpreters of AutoCAD and BricsCAD. It can help you perform various tasks related to drives, paths, folders, files, print, configuration, processes, interface, strings, math, CAD and system. It is easy to install and use for AutoCAD 2016 12 and other versions. It is also open-source and free to use.
If you are interested in learning more about Doslib or downloading it for your CAD application,
you can visit its official website at
https://wiki.mcneel.com/doslib/home.
DOS_TOKENIZE and DOS_STRFIND
These functions allow you to manipulate strings in various ways. DOS_TOKENIZE splits a string into a list of tokens based on a delimiter character. DOS_STRFIND finds the position of a substring within a string.
For example, you can use DOS_TOKENIZE to split a file name into its components like this:
(DOS_TOKENIZE "C:\\MyFolder\\MyFile.txt" "\\")
This will return a list of strings such as:
("C:" "MyFolder" "MyFile.txt")
You can use DOS_STRFIND to find the position of the file extension within the file name like this:
(DOS_STRFIND "MyFile.txt" ".")
This will return the number 6, which is the index of the dot character in the string. You can use these functions to perform various string operations such as parsing, searching, replacing, etc.
DOS_VECTOR and DOS_VDIST
These functions allow you to perform vector calculations. DOS_VECTOR creates a vector from two points or from a list of coordinates. DOS_VDIST calculates the distance between two vectors.
For example, you can use DOS_VECTOR to create a vector from two points like this:
(DOS_VECTOR '(0 0 0) '(1 1 1))
This will return a vector such as:
(1.0 1.0 1.0)
You can use DOS_VDIST to calculate the distance between two vectors like this:
(DOS_VDIST '(1 1 1) '(-1 -1 -1))
This will return the number 3.4641016151377544, which is the distance between the two vectors. You can use these functions to perform various vector operations such as addition, subtraction, dot product, cross product, angle, etc.
Conclusion
Doslib is a powerful tool for CAD programmers who want to enhance their LISP programming capabilities with functions that are not available in the native LISP interpreters of AutoCAD and BricsCAD. It can help you perform various tasks related to drives, paths, folders, files, print, configuration, processes, interface, strings, math, CAD and system. It is easy to install and use for AutoCAD 2016 12 and other versions. It is also open-source and free to use.
If you are interested in learning more about Doslib or downloading it for your CAD application,
you can visit its official website at
https://wiki.mcneel.com/doslib/home.
DOS_SAVALL and DOS_CLOSEALL
These functions allow you to save and close all open files in AutoCAD. DOS_SAVALL saves all open files without prompting. DOS_CLOSEALL closes all open files without prompting.
For example, you can use DOS_SAVALL to save all open files like this:
(DOS_SAVALL)
This will save all open files and return T if successful or NIL otherwise. You can use DOS_CLOSEALL to close all open files like this:
(DOS_CLOSEALL)
This will close all open files and return T if successful or NIL otherwise. You can use these functions to automate your file management tasks or to perform batch operations on multiple files.
DOS_PREVIEW and DOS_XREFS
These functions allow you to preview drawings and list xrefs in AutoCAD. DOS_PREVIEW displays a preview image of a drawing file in a dialog box. DOS_XREFS returns a list of xrefs attached to a drawing file.
For example, you can use DOS_PREVIEW to preview a drawing file like this:
(DOS_PREVIEW "C:\\MyFolder\\MyFile.dwg")
This will display a dialog box with a preview image of the drawing file C:\\MyFolder\\MyFile.dwg. You can use DOS_XREFS to list the xrefs attached to a drawing file like this:
(DOS_XREFS "C:\\MyFolder\\MyFile.dwg")
This will return a list of xrefs attached to the drawing file C:\\MyFolder\\MyFile.dwg, such as:
("C:\\XrefFolder\\Xref1.dwg" "C:\\XrefFolder\\Xref2.dwg" "C:\\XrefFolder\\Xref3.dwg")
You can use these functions to inspect your drawing files or to perform operations on xrefs.
Conclusion
Doslib is a powerful tool for CAD programmers who want to enhance their LISP programming capabilities with functions that are not available in the native LISP interpreters of AutoCAD and BricsCAD. It can help you perform various tasks related to drives, paths, folders, files, print, configuration, processes, interface, strings, math, CAD and system. It is easy to install and use for AutoCAD 2016 12 and other versions. It is also open-source and free to use.
If you are interested in learning more about Doslib or downloading it for your CAD application,
you can visit its official website at
https://wiki.mcneel.com/doslib/home.
a8ba361960