Land F/X
  • Portal
  • Products
    • Design F/X
    • Planting F/X
    • Irrigation F/X
    • F/X CAD
    • Plugin for Revit®
    • Plugin for SketchUp®
    • Lighting
    • Plugin for Rhino®
    • Manufacturer Connection
    • Academic
  • Support
  • Videos
  • Who We Are
  • Trial
  • Purchase
Land F/X
  • Portal
    • Dashboard
    • Account
    • Licenses
    • Data
    • Support
  • Products
    • Design F/X
      • Product
      • Features
      • Trial
      • Purchase
    • Planting F/X
      • Product
      • Features
      • Trial
      • Purchase
    • Irrigation F/X
      • Product
      • Features
      • Trial
      • Purchase
    • F/X CAD
    • Plugin for Revit®
    • Plugin for SketchUp®
    • Plugin for Rhino®
    • Site & Hardscape
    • Lighting
    • Manufacturer Connection
    • Academic
    • Purchase
  • Support
    • Knowledge Base
    • Documentation
    • Submit Ticket
    • Updates
    • Forum
    • Install
    • Remote Assistance
  • Videos
    • Power Tips
    • Webinars
  • Who We Are
    • Contact Us
    • Careers
    • Gallery
    • News
  1. Videos

AutoLISP Basics

{"3":{"id":3,"title":"Video Length","name":"video-length","checked_out":null,"checked_out_time":null,"note":"","state":1,"access":1,"created_time":"2023-12-15 00:00:00","created_user_id":48,"ordering":0,"language":"*","fieldparams":{"filter":"","maxlength":""},"params":{"hint":"","class":"","label_class":"","show_on":"","showon":"","render_class":"","value_render_class":"","showlabel":"1","label_render_class":"","display":"2","prefix":"","suffix":"","layout":"","display_readonly":"2"},"type":"text","default_value":"","context":"com_content.article","group_id":2,"label":"Video Length","description":"","required":0,"only_use_in_subform":0,"language_title":null,"language_image":null,"editor":null,"access_level":"Public","author_name":"Forrestt Williams","group_title":"videos","group_access":1,"group_state":1,"group_note":"","value":"","rawvalue":""},"7":{"id":7,"title":"Presented By","name":"presented-by","checked_out":null,"checked_out_time":null,"note":"","state":1,"access":1,"created_time":"2023-12-15 00:00:00","created_user_id":48,"ordering":0,"language":"*","fieldparams":{"filter":"","maxlength":""},"params":{"hint":"","class":"","label_class":"","show_on":"","showon":"","render_class":"","value_render_class":"","showlabel":"1","label_render_class":"","display":"2","prefix":"","suffix":"","layout":"","display_readonly":"2"},"type":"text","default_value":"","context":"com_content.article","group_id":2,"label":"Presented By","description":"","required":0,"only_use_in_subform":0,"language_title":null,"language_image":null,"editor":null,"access_level":"Public","author_name":"Forrestt Williams","group_title":"videos","group_access":1,"group_state":1,"group_note":"","value":"","rawvalue":""},"11":{"id":11,"title":"vimeo-id","name":"vimeo-id","checked_out":null,"checked_out_time":null,"note":"","state":1,"access":1,"created_time":"2023-12-15 00:00:00","created_user_id":48,"ordering":0,"language":"*","fieldparams":{"filter":"","maxlength":""},"params":{"hint":"","class":"","label_class":"","show_on":"","showon":"","render_class":"","value_render_class":"","showlabel":"1","label_render_class":"","display":"2","prefix":"","suffix":"","layout":"","display_readonly":"2"},"type":"text","default_value":"","context":"com_content.article","group_id":2,"label":"vimeo-id","description":"","required":0,"only_use_in_subform":0,"language_title":null,"language_image":null,"editor":null,"access_level":"Public","author_name":"Forrestt Williams","group_title":"videos","group_access":1,"group_state":1,"group_note":"","value":"277699920","rawvalue":"277699920"},"23":{"id":23,"title":"registration-link","name":"registration-link","checked_out":null,"checked_out_time":null,"note":"","state":1,"access":1,"created_time":"2023-12-15 00:00:00","created_user_id":48,"ordering":0,"language":"*","fieldparams":{"filter":"","maxlength":""},"params":{"hint":"","class":"","label_class":"","show_on":"","showon":"","render_class":"","value_render_class":"","showlabel":"1","label_render_class":"","display":"2","prefix":"","suffix":"","layout":"","display_readonly":"2"},"type":"text","default_value":"","context":"com_content.article","group_id":2,"label":"registration-link","description":"","required":0,"only_use_in_subform":0,"language_title":null,"language_image":null,"editor":null,"access_level":"Public","author_name":"Forrestt Williams","group_title":"videos","group_access":1,"group_state":1,"group_note":"","value":"","rawvalue":""},"24":{"id":24,"title":"webinar-date","name":"webinar-date","checked_out":null,"checked_out_time":null,"note":"","state":1,"access":1,"created_time":"2023-12-15 00:00:00","created_user_id":48,"ordering":0,"language":"*","fieldparams":{"filter":"","maxlength":""},"params":{"hint":"","class":"","label_class":"","show_on":"","showon":"","render_class":"","value_render_class":"","showlabel":"1","label_render_class":"","display":"2","prefix":"","suffix":"","layout":"","display_readonly":"2"},"type":"text","default_value":"","context":"com_content.article","group_id":2,"label":"webinar-date","description":"","required":0,"only_use_in_subform":0,"language_title":null,"language_image":null,"editor":null,"access_level":"Public","author_name":"Forrestt Williams","group_title":"videos","group_access":1,"group_state":1,"group_note":"","value":"","rawvalue":""},"37":{"id":37,"title":"Registration","name":"registration","checked_out":null,"checked_out_time":null,"note":"","state":1,"access":1,"created_time":"2023-12-15 00:00:00","created_user_id":48,"ordering":0,"language":"*","fieldparams":{"filter":"","maxlength":""},"params":{"hint":"","class":"","label_class":"","show_on":"","showon":"","render_class":"","value_render_class":"","showlabel":"1","label_render_class":"","display":"2","prefix":"","suffix":"","layout":"","display_readonly":"2"},"type":"text","default_value":"","context":"com_content.article","group_id":2,"label":"Registration","description":"","required":0,"only_use_in_subform":0,"language_title":null,"language_image":null,"editor":null,"access_level":"Public","author_name":"Forrestt Williams","group_title":"videos","group_access":1,"group_state":1,"group_note":"","value":"","rawvalue":""},"43":{"id":43,"title":"App Video Link","name":"app-video-link","checked_out":null,"checked_out_time":null,"note":"","state":1,"access":1,"created_time":"2023-12-15 00:00:00","created_user_id":48,"ordering":0,"language":"*","fieldparams":{"filter":"","maxlength":""},"params":{"hint":"","class":"","label_class":"","show_on":"","showon":"","render_class":"","value_render_class":"","showlabel":"1","label_render_class":"","display":"2","prefix":"","suffix":"","layout":"","display_readonly":"2"},"type":"text","default_value":"","context":"com_content.article","group_id":2,"label":"App Video Link","description":"","required":0,"only_use_in_subform":0,"language_title":null,"language_image":null,"editor":null,"access_level":"Public","author_name":"Forrestt Williams","group_title":"videos","group_access":1,"group_state":1,"group_note":"","value":"","rawvalue":""},"44":{"id":44,"title":"Webinar Vimeo ID","name":"webinar-vimeo-id","checked_out":null,"checked_out_time":null,"note":"","state":1,"access":1,"created_time":"2023-12-15 00:00:00","created_user_id":48,"ordering":0,"language":"*","fieldparams":{"filter":"","maxlength":""},"params":{"hint":"","class":"","label_class":"","show_on":"","showon":"","render_class":"","value_render_class":"","showlabel":"1","label_render_class":"","display":"2","prefix":"","suffix":"","layout":"","display_readonly":"2"},"type":"text","default_value":"","context":"com_content.article","group_id":2,"label":"Webinar Vimeo ID","description":"","required":0,"only_use_in_subform":0,"language_title":null,"language_image":null,"editor":null,"access_level":"Public","author_name":"Forrestt Williams","group_title":"videos","group_access":1,"group_state":1,"group_note":"","value":"277699920","rawvalue":"277699920"},"46":{"id":46,"title":"ManualDate","name":"manualdate","checked_out":null,"checked_out_time":null,"note":"","state":1,"access":1,"created_time":"2023-12-15 00:00:00","created_user_id":48,"ordering":0,"language":"*","fieldparams":{"filter":"","maxlength":""},"params":{"hint":"","class":"","label_class":"","show_on":"","showon":"","render_class":"","value_render_class":"","showlabel":"1","label_render_class":"","display":"2","prefix":"","suffix":"","layout":"","display_readonly":"2"},"type":"text","default_value":"","context":"com_content.article","group_id":2,"label":"ManualDate","description":"","required":0,"only_use_in_subform":0,"language_title":null,"language_image":null,"editor":null,"access_level":"Public","author_name":"Forrestt Williams","group_title":"videos","group_access":1,"group_state":1,"group_note":"","value":"","rawvalue":""},"49":{"id":49,"title":"Manufacturer Video Type","name":"manufacturer-video-type","checked_out":null,"checked_out_time":null,"note":"","state":1,"access":1,"created_time":"2023-12-15 00:00:00","created_user_id":48,"ordering":0,"language":"*","fieldparams":{"filter":"","maxlength":""},"params":{"hint":"","class":"","label_class":"","show_on":"","showon":"","render_class":"","value_render_class":"","showlabel":"1","label_render_class":"","display":"2","prefix":"","suffix":"","layout":"","display_readonly":"2"},"type":"text","default_value":"","context":"com_content.article","group_id":2,"label":"Manufacturer Video Type","description":"","required":0,"only_use_in_subform":0,"language_title":null,"language_image":null,"editor":null,"access_level":"Public","author_name":"Forrestt Williams","group_title":"videos","group_access":1,"group_state":1,"group_note":"","value":"","rawvalue":""},"50":{"id":50,"title":"Manufacturer Video Company","name":"manufacturer-video-company","checked_out":null,"checked_out_time":null,"note":"","state":1,"access":1,"created_time":"2023-12-15 00:00:00","created_user_id":48,"ordering":0,"language":"*","fieldparams":{"filter":"","maxlength":""},"params":{"hint":"","class":"","label_class":"","show_on":"","showon":"","render_class":"","value_render_class":"","showlabel":"1","label_render_class":"","display":"2","prefix":"","suffix":"","layout":"","display_readonly":"2"},"type":"text","default_value":"","context":"com_content.article","group_id":2,"label":"Manufacturer Video Company","description":"","required":0,"only_use_in_subform":0,"language_title":null,"language_image":null,"editor":null,"access_level":"Public","author_name":"Forrestt Williams","group_title":"videos","group_access":1,"group_state":1,"group_note":"","value":"","rawvalue":""}}

June 29, 2018

AutoLISP is a hidden gem within AutoCAD xxx – a robust and capable programming language that’s easy to test and develop right from the CAD Command line. Land F/X CEO Jeremiah Farmer has been working with AutoLISP for more than 20 years and will start you off with the basics. This webinar will include recommendations on development environment, best coding practices, and helpful resources along the way. We’ll even program a simple function in real time to show you how it all comes together.

 

 

Webinar attachments:

  • AutoLISP Basics files

 

Webinar Contents:

Note: The following catalog of content covered in this webinar is time stamped to allow you to follow along or skip to sections of the video that are relevant to your questions. You can also search for content on this page using the FIND command in your browser (CTRL + F in Windows, Command + F in Mac OS.)

  • Intro/TOC
  • What is AutoLISP?
  • What Can Be Done with AutoLISP?
  • Data Types, Function Organization, Code Techniques
  • Do’s and Do Not Do’s
  • Development Environment
  • Make a Simple Function!

 

0:00 – 3:32: Intro/TOC

3:33 – 6:02: What is AutoLISP?

  • Command line interpreted programming language (i.e., it’s not compiled somewhere else and then run as a binary executable. It’s fed, line by line, to the AutoCAD Command line.)
  • Intermix commands and complete functions
    • Functions can run AutoCAD commands
    • Any AutoLISP statement or function can be tested at the Command line.
    • Functions can prompt for input, display dialog boxes, modify entries.
    • Complete program can have a ribbon, database access, cloud connectivity, create/download blocks, wrap AutoCAD commands (e.g., Land F/X).
  • A very powerful addition to AutoCAD!

 

LISP basics (5:25)

LISP is a language of mathematics.

6:03 – 8:14: What Can Be Done with AutoLISP?

LISP essentials, operators and operants (6:03)

8:15 – 29:05: Data Types, Function Organization, Code Techniques

Data types (8:15)

  • Boolean – example: t / nil
  • Integer ­– example: 0, 1, 2, 3, -65536, 1073741824
  • Real ­– example: 3.141592653589793
  • String – example: “Hi, Mom!”

 

Lists (10:15)

  • Basic – example: (1 2 3 4)
  • Very common: a point – example: (101.222 319.045 0.0)

In other programming languages, you would need to declare a variable as a 3D point. In AutoLISP, a point is simply a list that includes three real numbers.

  • Lists within lists – example: ( (0 . 10.0) (1 . 4) (2 . “Hi, Mom”) (3 . 75.44139) )
  • Entity access – example: ( (0 . “LINE”) (67 . 0) (8 . “0”) (10 250.831 43.694 0.0) (11 271.714 55.7062 0.0) )

This example shows a line between two particular points in Model Space.

 

Command Line calls (14:32)

 

Function basics (18:45)

 

Vocabulary (21:47)

Autodesk has a Functions Reference page for AutoLISP, where you can learn all the functions. 

 

Examples of LISP vocabulary (23:55)

 

Design philosophy (26:20)

 

Example of Land F/X code (27:30)

 

Comments (28:55)

29:06 – 30:54: Do’s and Do Not Do’s

The importance of including comments in your code (29:06)

30:55 – 34:19: Development Environment

Our recommendations:

  • UltraEdit
    • AutoLISP word file (autolisp.uew)
    • Nice code writing font (Source Code Pro, Lucida Console)
  • AutoCAD Support File Search Path
  • -ommand to reload
  • Error function

 

Getting help (32:35)

  • AutoLISP forums
    • Autodesk
    • The Swamp
    • AUGI
    • CadTutor
    • AfraLISP
    • (Take the time to learn proper forum etiquette.)
  • Lee Mac
    • Tutorials and very helpful tools
  • (Beware of bad code writing habits!)

34:20 – end: Make a Simple Function!

Examples of creating a simple function with and without a helper function (34:20)

 

Example of writing code for a function: selecting a layer and changing its color (38:25)

 

Checking the list of AutoCAD entities and their codes (43:17)

 

Error checking (51:10)

 

Question: Do you recommend using an integrated development environment (IDE)? (55:40)

Answer: Yes, but  Jeremiah doesn’t recommend using the Autodesk IDE. Autodesk stopped developing AutoLISP in 2002, so their IDE is quite difficult to work with. He recommends using a good code editor such as:

UltraEdit

Notepad++

 

Above all, make sure to:

  • Program slowly and meticulously
  • Put in your own breakpoints
  • Include access panels (and leave them in place)

 

How to adjust the LISP function created in this presentation if all lines inside a block are on Layer 0, how would you adjust the LISP created in this presentation (58:05)

Contact

  • Land F/X
  • PMB 351
    3940 Broad St. STE 7
    San Luis Obispo, CA 93401
  • +1 805-541-1003
Email Logo Facebook Logo Instagram Logo LinkedIn Logo
Land F/X Logo

Our software tailors AutoCAD®, Revit®, SketchUp®, and Rhino® to the needs of landscape architects, irrigation designers, and other professionals. We automate your most tedious tasks and ensure accuracy, giving you more time to design.

  • Portal
  • Products
  • Support
  • Videos
  • Who We Are