Author Topic: ENTMAKE function  (Read 38609 times)

0 Members and 1 Guest are viewing this topic.

ElpanovEvgeniy

  • Water Moccasin
  • Posts: 1540
  • Moscow (Russia)
Re: ENTMAKE function
« Reply #60 on: April 05, 2007, 11:58:15 PM »


This is done by stripping the unwanted dxf codes from the entlist before writing the list to the lisp file.

What for?
It is possible to leave a full code - all will work!
For example, my variant of copying of objects on base LISP, as vla-copy
Code: [Select]
(entmakex(entget(car(entsel))))
蝸牛そろそろ登れ富士の山 /Kobayashi Issa/

CAB

  • Global Moderator
  • Seagull
  • Posts: 10365
Re: ENTMAKE function
« Reply #61 on: April 06, 2007, 07:18:02 AM »
Perhaps I have not understood the entmakex function.

In my test with entmake, some entities would not make unless I removed some of the dxf codes. Testing was done in ACAD2000.
Keep in mind that the entity list created by my routine are written to a lisp file and may be used to create the cloned entity in another drawing and or space.
I primarily use it to create an entmake to be added to a lisp routine so I can create the entity for the first time in a drawing.

Are you are telling me that if I use entmakex I may leave all the dxf codes in without penalty?
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.

ElpanovEvgeniy

  • Water Moccasin
  • Posts: 1540
  • Moscow (Russia)
Re: ENTMAKE function
« Reply #62 on: April 06, 2007, 07:25:20 AM »
Are you are telling me that if I use entmakex I may leave all the dxf codes in without penalty?
Yes! :)
For 2004-2008 acad...
蝸牛そろそろ登れ富士の山 /Kobayashi Issa/

CAB

  • Global Moderator
  • Seagull
  • Posts: 10365
Re: ENTMAKE function
« Reply #63 on: April 06, 2007, 07:30:03 AM »
OK, that clears that up. Thanks.
I need to move into the present. :-) Or at least ACAD2006.
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.

ElpanovEvgeniy

  • Water Moccasin
  • Posts: 1540
  • Moscow (Russia)
Re: ENTMAKE function
« Reply #64 on: April 14, 2007, 03:33:45 AM »
Creation of hatch with the instruction of a pattern, a angle and scale.

Code: [Select]
(defun entmakex-hatch (L a n s)
 ;; By ElpanovEvgeniy
 ;; L - list point
 ;; A - angle hatch
 ;; N - name pattern
 ;; S - scale

 ;; returne - hatch ename
 (entmakex
  (apply
   'append
   (list
    (list '(0 . "HATCH")
          '(100 . "AcDbEntity")
          '(410 . "Model")
          '(100 . "AcDbHatch")
          '(10 0.0 0.0 0.0)
          '(210 0.0 0.0 1.0)
          '(2 . "ANSI31")
          (if (= n "SOLID")
           '(70 . 1)
           '(70 . 0)
          ) ;_  if
          '(71 . 0)
          (cons 91 (length l))
    ) ;_  list
    (apply 'append
           (mapcar '(lambda (a)
                     (apply 'append
                            (list (list '(92 . 7) '(72 . 0) '(73 . 1) (cons 93 (length a)))
                                  (mapcar '(lambda (b) (cons 10 b)) a)
                                  '((97 . 0))
                            ) ;_  list
                     ) ;_  apply
                    ) ;_  lambda
                   l
           ) ;_  mapcar
    ) ;_  apply
    (list '(75 . 0)
          '(76 . 1)
          (cons 52 a)
          (cons 41 s)
          '(77 . 0)
          '(78 . 1)
          (cons 53 a)
          '(43 . 0.)
          '(44 . 0.)
          '(45 . 1.)
          '(46 . 1.)
          '(79 . 0)
          '(47 . 1.)
          '(98 . 2)
          '(10 0. 0. 0.0)
          '(10 0. 0. 0.0)
          '(451 . 0)
          '(460 . 0.0)
          '(461 . 0.0)
          '(452 . 1)
          '(462 . 1.0)
          '(453 . 2)
          '(463 . 0.0)
          '(463 . 1.0)
          '(470 . "LINEAR")
    ) ;_  list
   ) ;_  list
  ) ;_  apply
 ) ;_  entmakex
) ;_  defun

Check:

Code: [Select]
(entmakex-hatch '(((538.794 584.563) (895.629 584.563) (895.629 997.377) (538.794 997.377))
                  ((386.809 345.13) (670.955 345.13) (670.955 855.369) (386.809 855.369))
                 )
                (/ pi 2)
                "ANSI31"
                2.
) ;_  entmakex-hatch
(entmakex-hatch
 (list
  (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget (car (entsel)))))
 ) ;_  list
 (/ pi 2)
 "ANSI31"
 2.
)
蝸牛そろそろ登れ富士の山 /Kobayashi Issa/

KewlToyZ

  • Guest
Re: ENTMAKE function
« Reply #65 on: December 06, 2007, 10:31:18 PM »
OK, that clears that up. Thanks.
I need to move into the present. :-) Or at least ACAD2006.

I'm curious why you chose 2006 CAB?
2004 was blazing fast, 2006 added the cui but retained 2004 file formatting.
2007 refined use of the cui menu files created in 2006 and interface formatting had the maximum use for ToolPalette flexibility.
You could actually still export to xtp files for other users to import. Which was very beneficial in a network environment. The reason I mention those items for 2007 was you could actually use a routine like this to create a drawing that could then be used to export an entire tool palette of the objects in the drawing for use later through Design Center. Where it would be necessary I have not the foggiest but I'm sure people run into some obstacles this could shortcut considerably.

2008 disables the toolpalette export function...
« Last Edit: December 06, 2007, 10:38:57 PM by KewlToyZ »

CAB

  • Global Moderator
  • Seagull
  • Posts: 10365
Re: ENTMAKE function
« Reply #66 on: December 07, 2007, 12:35:17 AM »
Because I already own a copy of 2006 8-)
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.

KewlToyZ

  • Guest
Re: ENTMAKE function
« Reply #67 on: December 07, 2007, 08:14:56 PM »
LOL gotcha!  :lmao:

Pricing does have its woes.
I'm on subscription for 80 some licenses...talk about a major wallet hole that is.... :-o

Thanks CAB

wizman

  • Bull Frog
  • Posts: 225
Re: ENTMAKE function
« Reply #68 on: December 09, 2007, 05:32:35 AM »
THIS IS AMAZING, THANKS FOR SHARING, NOW I DONT HAVE TO WORRY IN MY ENTMAKE.

taner

  • Guest
Re: ENTMAKE function
« Reply #69 on: December 09, 2007, 06:57:58 PM »
Dear CAB,

what difference between your function replace and Subst?tks!
« Last Edit: April 05, 2011, 08:34:56 AM by CAB »

CAB

  • Global Moderator
  • Seagull
  • Posts: 10365
Re: ENTMAKE function
« Reply #70 on: December 09, 2007, 08:50:24 PM »
Been too long ago for my short memory, I'll have to look at it on Monday.
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.

taner

  • Guest
Re: ENTMAKE function
« Reply #71 on: February 06, 2009, 10:18:49 PM »
Been too long ago for my short memory, I'll have to look at it on Monday.


Many monday have past!

CAB

  • Global Moderator
  • Seagull
  • Posts: 10365
Re: ENTMAKE function
« Reply #72 on: February 06, 2009, 11:25:25 PM »
Many moons have past.  8-)

Looks like they do the same thing.
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.

TimSpangler

  • Water Moccasin
  • Posts: 2010
  • CAD Naked!!
Re: ENTMAKE function
« Reply #73 on: March 09, 2009, 12:22:02 PM »
Emake Wipeouts

Thanks to Joe Burke and Gile and a bit of TT I believe

Works great, not sure which versions it works in.  Maybe some testing will tell.
ACA 2015 - Windows 7 Pro
All Comments and Content by TimSpangler, Copyright 2016

flopo

  • Guest
Re: ENTMAKE function
« Reply #74 on: April 05, 2011, 06:32:48 AM »
Helo Cab,
I want to use your lisp entmake with a macro to insert some objects in a drawing. When i generate the lisp that create those objects, i move them somewhere centered to 0,0,0 point - origin. I do this because i want to insert those object in a point that i will select on the drawing - and always those objects are drawn in their original locations, even if i change my ucs (with a small lisp). How can i insert those objects created with your entmake lisp in a point chosen on the drawing? Thanks!