Author Topic: getting lost trying to use entmake  (Read 1465 times)

0 Members and 1 Guest are viewing this topic.

MickB

  • Guest
getting lost trying to use entmake
« 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

Code: [Select]
(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

gile

  • Gator
  • Posts: 2520
  • Marseille, France
Re: getting lost trying to use entmake
« Reply #1 on: December 30, 2012, 06:28:47 AM »
Hi,

maybe a typo, use:
Code - Auto/Visual Lisp: [Select]
  1. (entmake (list ...))

instead of:
Code - Auto/Visual Lisp: [Select]
  1. (entmake list (...))
Speaking English as a French Frog

Lee Mac

  • Seagull
  • Posts: 12922
  • London, England
Re: getting lost trying to use entmake
« Reply #2 on: December 30, 2012, 06:37:40 AM »
You may also wish to refer to this very recent post:
http://www.theswamp.org/index.php?topic=43465.msg487019#msg487019

MickB

  • Guest
Re: getting lost trying to use entmake
« Reply #3 on: December 30, 2012, 07:09:05 AM »
Thanks Lee,

that worked a treat.

Mick


CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: getting lost trying to use entmake
« Reply #4 on: December 30, 2012, 09:35:49 AM »
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
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.