TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: MickB on December 30, 2012, 06:18:03 AM
-
Hi, I am try to get my head around using entmake.
I thought i'd try to select two points and draw a line between them, here is the code i'm using
(defun c:drawLine ()
(initget 1)
(Setq pSP (Getpoint "\nSelect Start Point : "))
(Setq pEP (Getpoint "\nSelect End Point : "))
(entmake
list(
'(0 . "LINE")
'(100 . "AcDbEntity")
'(67 . 0)
'(8 . "0")
'(100 . "AcDbLine")
(cons 10 pSP) ;;Start Point
(cons 11 pEP) ;;End point
)
)
)
The error message I'm getting is:
"error: bad function: (0 . "LINE")"
Can anyone tell me where I'm going wrong?
Thanks
Mick
-
Hi,
maybe a typo, use:
instead of:
-
You may also wish to refer to this very recent post:
http://www.theswamp.org/index.php?topic=43465.msg487019#msg487019 (http://www.theswamp.org/index.php?topic=43465.msg487019#msg487019)
-
Thanks Lee,
that worked a treat.
Mick
-
More food for thought: 8-)
;;;=======================[ MakeEntmake.lsp ]==================================
;;; Author: Charles Alan Butler Copyright© 2005-2012
;;; Version: 1.5 Nov. 10, 2012
;;; Purpose: To create a lisp that will recreate the objects selected
;;; Will not process xref or nested blocks, blocks are created
;;; from Inserts but no insert is created, you must insert
;;; Output; A lisp file with the name of the drawing contailing the lisp code
;;; Sub_Routines:
;;; _replace - replace in string
;;; dxfstrip - Strip dxf from list
;;; make_complex - Write additional lines needed for complex objects
;;; dxf - return value from a dotted pair
;;; ToString - convert item to a string by MP
;;; Requirements: -None
;;; Returns: -None
;;; Original Thread: http://www.theswamp.org/index.php?topic=4814.0
;;; Latest Version: http://www.theswamp.org/index.php?topic=31145