Author Topic: ENTMAKE function  (Read 38642 times)

0 Members and 1 Guest are viewing this topic.

MP

  • Seagull
  • Posts: 17454
ENTMAKE function
« Reply #30 on: April 19, 2005, 05:06:58 PM »
I changed the ToString def'n Alan, but I left your reference of it alone.
\|// Set goal. Experiment tirelessly until
|Oo| practice has become expertise.  Loop.
|- | LinkedIn | Dropbox

CAB

  • Global Moderator
  • Seagull
  • Posts: 10366
ENTMAKE function
« Reply #31 on: April 19, 2005, 06:03:17 PM »
The Hatch is not a complex object as i stated but if it is associative it will not entmake.
So I removed the associative dxf flags & it will entmake a non-associate hatch.
I updated the code above.
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.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10366
ENTMAKE function
« Reply #32 on: April 19, 2005, 06:13:15 PM »
Quote from: MP
I changed the ToString def'n Alan, but I left your reference of it alone.

Yea, I think we are in sync with the exception of my added zero remover. :)
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.

MP

  • Seagull
  • Posts: 17454
ENTMAKE function
« Reply #33 on: April 19, 2005, 06:24:06 PM »
Better look again.

:)
\|// Set goal. Experiment tirelessly until
|Oo| practice has become expertise.  Loop.
|- | LinkedIn | Dropbox

CAB

  • Global Moderator
  • Seagull
  • Posts: 10366
ENTMAKE function
« Reply #34 on: April 19, 2005, 06:25:07 PM »
I did some research on entmake & Mline.
Conclusion, don't waste your time. It aint gonna happen. :shock:
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.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10366
ENTMAKE function
« Reply #35 on: April 19, 2005, 06:39:31 PM »
Quote from: MP
Better look again.:)

Oh, you love an Easter egg hunt don't you. :)

I think this is the only difference
(rtos x 2 (if (zerop (- x (fix x))) 1 15))
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.

MP

  • Seagull
  • Posts: 17454
ENTMAKE function
« Reply #36 on: April 19, 2005, 06:41:28 PM »
Ta da!

:)
\|// Set goal. Experiment tirelessly until
|Oo| practice has become expertise.  Loop.
|- | LinkedIn | Dropbox

CAB

  • Global Moderator
  • Seagull
  • Posts: 10366
ENTMAKE function
« Reply #37 on: April 23, 2005, 01:47:50 PM »
Here is a rewrite of the routine.
It will handle all the objects previously tested except mLines.
Additionally excluded are nested blocks, xrefs, Raster, Tolerance, XRecord
Other objects may also excluded if they are new in ACAD 2002+
Ron, if you are up for it please retest the objects you tested before to
confirm it is working. Thanks.

Note that Inserts will result in a block being created which does not create
the actual Insert. The actual Insert must be created by the end user.

MakeEntmake.lsp
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.

ronjonp

  • Needs a day job
  • Posts: 7028
ENTMAKE function
« Reply #38 on: April 24, 2005, 01:43:17 PM »
CAB,

Here is the results for the latest test: (blank did not create)



HTH

Ron

Windows 10 x64 - AutoCAD /C3D 2020

Custom Build PC

CAB

  • Global Moderator
  • Seagull
  • Posts: 10366
ENTMAKE function
« Reply #39 on: April 24, 2005, 11:47:13 PM »
OK Ron, lets try again,
Fixed Hatch, Dim & Attdef

I think Block works, NOTE, the eMake will create a BLOCK definition which does not create
a visible object in the drawing. You must INSERT the new block.
I guess I could take it a step further & create the INSERT code as well.
Not sure anyone will need that code, do you?
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.

ronjonp

  • Needs a day job
  • Posts: 7028
ENTMAKE function
« Reply #40 on: April 25, 2005, 09:30:12 AM »
CAB,
Looks like you got it nailed down :).



It might be handy for the block entmake to insert the block for you.

Thanks,

Ron

Windows 10 x64 - AutoCAD /C3D 2020

Custom Build PC

ronjonp

  • Needs a day job
  • Posts: 7028
Re: ENTMAKE function
« Reply #41 on: February 21, 2006, 12:15:53 PM »
CAB (or anyone else),

Is there a reason your routine won't make a block with attributes?

This is what is spits out:

Code: [Select]
(defun c:eMake ()
  (entmake '((0 . "BLOCK")
     (100 . "AcDbEntity")
     (67 . 0)
     (8 . "0")
     (100 . "AcDbBlockReference")
     (66 . 1)
     (2 . "dtitle")
     (10 0.0 0.0 0.0)
     (70 . 0)
    )
  )
  (entmake '((0 . "ATTDEF")
     (100 . "AcDbEntity")
     (67 . 0)
     (8 . "0")
     (100 . "AcDbText")
     (10 6.309332955476622 0.395557539427431 0.0)
     (40 . 0.100000000000000)
     (1 . "N.T.S.")
     (50 . 0.0)
     (41 . 1.0)
     (51 . 0.0)
     (7 . "standard")
     (71 . 0)
     (72 . 2)
     (11 6.752190098333765 0.395557539427431 0.0)
     (100 . "AcDbAttributeDefinition")
     (3 . "Scale:")
     (2 . "SCALE")
     (70 . 0)
     (73 . 0)
     (74 . 0)
    )
  )
  (entmake '((0 . "ATTDEF")
     (100 . "AcDbEntity")
     (67 . 0)
     (8 . "0")
     (100 . "AcDbText")
     (10 1.377632293917034 0.395557539427431 0.0)
     (40 . 0.250000000000000)
     (1 . "")
     (50 . 0.0)
     (41 . 1.0)
     (51 . 0.0)
     (7 . "standard")
     (71 . 0)
     (72 . 0)
     (11 0.0 0.0 0.0)
     (100 . "AcDbAttributeDefinition")
     (3 . "Second line:")
     (2 . "NAME2")
     (70 . 0)
     (73 . 0)
     (74 . 0)
    )
  )
  (entmake '((0 . "ATTDEF")
     (100 . "AcDbEntity")
     (67 . 0)
     (8 . "0")
     (100 . "AcDbText")
     (10 1.377632293917034 0.770557539427431 0.0)
     (40 . 0.250000000000000)
     (1 . "")
     (50 . 0.0)
     (41 . 1.0)
     (51 . 0.0)
     (7 . "standard")
     (71 . 0)
     (72 . 0)
     (11 0.0 0.0 0.0)
     (100 . "AcDbAttributeDefinition")
     (3 . "First line:")
     (2 . "NAME1")
     (70 . 0)
     (73 . 0)
     (74 . 0)
    )
  )
  (entmake '((0 . "ATTDEF")
     (100 . "AcDbEntity")
     (67 . 0)
     (8 . "0")
     (100 . "AcDbText")
     (10 0.652977042930451 0.639190527874698 0.0)
     (40 . 0.250000000000000)
     (1 . "")
     (50 . 0.0)
     (41 . 1.0)
     (51 . 0.0)
     (7 . "standard")
     (71 . 0)
     (72 . 4)
     (11 0.750095051115990 0.764190527874698 0.0)
     (100 . "AcDbAttributeDefinition")
     (3 . "Number:")
     (2 . "#")
     (70 . 0)
     (73 . 0)
     (74 . 0)
    )
  )
  (entmake '((0 . "LWPOLYLINE")
     (100 . "AcDbEntity")
     (67 . 0)
     (8 . "0")
     (100 . "AcDbPolyline")
     (90 . 3)
     (70 . 0)
     (43 . 0.020000000000000)
     (38 . 0.0)
     (39 . 0.0)
     (10 1.245930039763611 0.721912612736174)
     (40 . 0.020000000000000)
     (41 . 0.020000000000000)
     (42 . 1.064411829348489)
     (10 0.252853063807763 0.744437955044491)
     (40 . 0.020000000000000)
     (41 . 0.020000000000000)
     (42 . 0.947434764959047)
     (10 1.245930039763611 0.721912612736174)
     (40 . 0.020000000000000)
     (41 . 0.020000000000000)
     (42 . -0.926144858212555)
    )
  )
  (entmake '((0 . "LWPOLYLINE")
     (100 . "AcDbEntity")
     (67 . 0)
     (8 . "0")
     (100 . "AcDbPolyline")
     (90 . 2)
     (70 . 0)
     (43 . 0.020000000000000)
     (38 . 0.0)
     (39 . 0.0)
     (10 1.245930039763611 0.721912612736174)
     (40 . 0.020000000000000)
     (41 . 0.020000000000000)
     (42 . 0.0)
     (10 6.750564105741474 0.721912612736174)
     (40 . 0.020000000000000)
     (41 . 0.020000000000000)
     (42 . 0.0)
    )
  )
  (entmake '((0 . "ENDBLK") (100 . "AcDbBlockEnd") (8 . "0")))
  (princ)
) ; end eMaker

Thanks,

Ron

Windows 10 x64 - AutoCAD /C3D 2020

Custom Build PC

CAB

  • Global Moderator
  • Seagull
  • Posts: 10366
Re: ENTMAKE function
« Reply #42 on: February 21, 2006, 01:57:24 PM »
Here is an update. :)
Fixed bug   8-)

<code removed: see link for latest version>
http://www.theswamp.org/index.php?topic=31145.0
« Last Edit: April 05, 2011, 08:54:27 AM by CAB »
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.

ronjonp

  • Needs a day job
  • Posts: 7028
Re: ENTMAKE function
« Reply #43 on: February 21, 2006, 03:47:42 PM »
CAB,

You are amazing! Thanks.

Ron

Windows 10 x64 - AutoCAD /C3D 2020

Custom Build PC

CAB

  • Global Moderator
  • Seagull
  • Posts: 10366
Re: ENTMAKE function
« Reply #44 on: February 21, 2006, 03:59:20 PM »
No problem & thanks.

The bug was that I used the (70 . 0) by default and the fix was to get the actual dxf 70 code
from the block data which in this case was (70 . 2)
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.