Author Topic: create a new entity  (Read 2586 times)

0 Members and 1 Guest are viewing this topic.

TopoWAR

  • Newt
  • Posts: 135
create a new entity
« on: January 28, 2012, 02:13:10 PM »
hello, you can create a new entity in AutoCAD from Lisp.
example:

thanks
Thanks for help

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: create a new entity
« Reply #1 on: January 28, 2012, 02:53:50 PM »
Check these out.

Code: [Select]
----------  Entmake   ----------------------
http://www.theswamp.org/index.php?topic=31145.0  ENTMAKE function by CAB
http://www.theswamp.org/index.php?topic=4814.msg112107#msg112107 
http://www.theswamp.org/index.php?topic=17445.0  Min codes
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.

TopoWAR

  • Newt
  • Posts: 135
Re: create a new entity
« Reply #2 on: January 28, 2012, 03:11:01 PM »
CAB
thanks for replying, but routine creates MakeEntmake.lsp existing entities, circle, point, text .... I take care to create a new entity, such as:
TPLDTOPOLGCADNODE, see the picture above. NET can, but the question is: can with lisp. ? a clear example:
loaded application that creates the point
Code: [Select]
((-1 . <Entity name: 3110210>) (0 . "TPLDTOPOLGCADNODE") (330 . <Entity name: 31100f8>) (5 . "52") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "PUNTOS") (100 . "TPLDTopoLGCADNode") (70 . 1) (140 . 272.43) (141 . 205.819) (142 . 100.0) (143 . 1.5) (144 . 0.5) (90 . 1))not loaded application that creates the point
Code: [Select]
((-1 . <Entity name: 7efc3dd0>) (0 . "ACAD_PROXY_ENTITY") (330 .
<Entity name: 7efc3cf8>) (5 . "52") (100 . "AcDbEntity") (67 . 0) (410 .
"Model") (8 . "PUNTOS"))

Please see dwg
« Last Edit: January 28, 2012, 03:48:55 PM by TopoWAR »
Thanks for help

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: create a new entity
« Reply #3 on: January 28, 2012, 07:04:14 PM »
My version of ACAD (2006 plain) does not support that entity so I can't test this.
Give it a try.
Code: [Select]
(entmakex
  '((0 . "TPLDTOPOLGCADNODE")
    (5 . "52")
    (100 . "AcDbEntity")
    (67 . 0)
    (410 . "Model")
    (8 . "PUNTOS")
    (100 . "TPLDTopoLGCADNode")
    (70 . 1)
    (140 . 272.43)
    (141 . 205.819)
    (142 . 100.0)
    (143 . 1.5)
    (144 . 0.5)
    (90 . 1)
   )
)
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.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: create a new entity
« Reply #4 on: January 28, 2012, 07:20:21 PM »
This is a guess
TopoLGCAD may create custom objects and AutoCAD needs TopoLGCAD or an enabler installed to read/display the entities.

You MAY be able to create the objects with Lisp so that they are database resident BUT AutoCad may not know how to display the objects.

[/just a guess]
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

TopoWAR

  • Newt
  • Posts: 135
Re: create a new entity
« Reply #5 on: January 28, 2012, 07:54:13 PM »
CAB
your code does not work, choose to use to recognize an entity xdata
Thanks for help

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: create a new entity
« Reply #6 on: January 28, 2012, 09:24:59 PM »
Looking at the drawing object I see a simple + (2 lines) with text bundled into what looks like a block but the block is a proxy object.
I can't deal with that proxy with my system, sorry.
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.