CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz]
CZ | EN | DE
Login or
registration
  Visitors: 5583

CAD tip CAD tip # 7840:

   
Question CAD 
 %  platform  category 
Q - question

What are the differences between AutoLISP and VisualLISP?

A - answer Dialects of the LISP programming language are available in AutoCAD since its initial versions. AutoLISP in AutoCAD offers functions for interactive data entry, processing and access to the AutoCAD drawing database (DWG). VisualLISP (originally "Vital LISP") was added to AutoCAD in the versions R14 (as an add-on) and 2000 (integrated).

With VisualLISP you can do more than with the pure AutoLISP - you can edit, compile and debug your programs, use object (ActiveX) functions and reactors. VisualLISP contains the integrated editing and debugging environment (IDE).

An example of a typical program in AutoLISP:

(defun C:Circle2 ()
(setq pt (getpoint "\nCenter of the circle: "))
(setq r (getdist r "\nRadius: "))
(command "_CIRCLE" pt r)
(command "_CIRCLE" pt (/ r 2.0))
(prin1)
) 

To create drawing objects you can either call AutoCAD commands - (command), or directly create entities - (entmake), or use ActiveX functions (vla-add*).

With VisualLISP, .lsp programs can be compiled to .vlx and .fas files (code protection, better performance).

Before calling COM (ActiveX) objects in VisualLISP you need to load the COM support with the function (vl-load-com).

ACAD
100% *  CAD 
7.3.2011    11984×  
Prices - CAD eShop:
applies to: AutoCAD ·

See also:
Tip 14085:JavaScript API support in AutoCAD and AutoCAD LT.
Tip 13683:Limitations of the LISP language (AutoLISP, VisualLISP) in AutoCAD LT - what to watch out for
Tip 12701:What is the maximum length of a list in AutoCAD VisualLISP?
Tip 11914:Maze generator for AutoCAD.
Tip 10955:Evaluate VBScript functions from AutoLISP.


Back   All CAD Tips



Have we helped you? If you want to support the CAD Forum web service, consider buying one of our CAD applications, or our custom software development offerings, or donating via PayPal (see above). You may also add a link to your web - like this "fan" link: CAD Forum - tips, utilities, blocks for Autodesk products
CAD:    OS:    Categ: 
Text:  FAQ glossary   



Featuring:
Use Google Earth images in your AutoCAD projects with the Plex.Earth Tools More info


Please use these tips at your own risk.
Arkance Systems is not responsible for possible problems that may occur as a result of using any of these tips.
TOPlist