Page 1 of 1

LISP to automate polyline report task

PostPosted: Fri Dec 03, 2021 3:06 pm
by jsorrels
Hello everyone I am looking to write a LISP that runs specific commands that I will use frequently. I am completely new to the world of LISP and have limited drafting experience but I do have intermediate programming experience. I want to use the command REVPLINE, PLCHGORG, and then LEGAL in that order. If you could help me with the general format and the syntax I would like to attempt to write the file myself. Any help is appreciated.

Re: LISP to automate polyline report task

PostPosted: Sat Dec 04, 2021 4:12 pm
by gskelhorn
There are a lot of resources for autolisp so google searches are very helpful.

A general tutorial on using the lisp command function:
https://www.tutorial-autocad.com/executing-autocad-commands-through-autolisp

When I was writing more lisp routines I found Afralisp https://www.afralisp.net/index.php and http://www.theswamp.org/ very useful.

Lee Mac has shared a wonderful amount of info at http://lee-mac.com/

A post from the swamp.org with a simple example:
https://www.theswamp.org/index.php?topic=55559.msg597106#msg597106

This example is selecting LINE entities. You will likely want to get LWPOLYLINE and POLYLINE and possibly filter out the 3D entities.

You can filter on the DXF group code 70 to exclude bit values 8, 16, 32 and 64 (sum is 120):
Code: Select all
(ssget '((0 . "*POLYLINE") (-4 . "<NOT") (-4 . "&") (70 . 120) (-4 . "NOT>")))


See command and ssget in the Intellicad help Developer Reference section and:
http://lee-mac.com/ssget.html
http://help.autodesk.com/view/OARX/2018/ENU/?guid=GUID-ABF6B778-BE20-4B49-9B58-A94E64CEFFF3
http://lee-mac.com/ssget.html