Author Topic: Don't know why this lisp doesn't work  (Read 3442 times)

0 Members and 1 Guest are viewing this topic.

Brick_top

  • Guest
Don't know why this lisp doesn't work
« on: March 23, 2011, 06:23:19 AM »
Hi there I found a routine but don't know why it doesn't work.

I took it from here http://forums.autodesk.com/t5/Visual-LISP-AutoLISP-and-General/delaunay-triangulation/m-p/871300

Here is the error I get "; error: Automation Error. Problem in loading application"

the debugger points to this section ->
Code: [Select]
(vla-getinterfaceObject
(vlax-get-acad-object)
"AcadX.Application"
)

Code: [Select]
(vl-load-com)

(if (not *acadx*)
(setq *acadx*
(vla-getinterfaceObject
(vlax-get-acad-object)
"AcadX.Application"
)
)
)

(defun VarIsArray (var)
(and
(eq (type var) 'variant)
(eq vlax-vbArray
(logand
(vlax-variant-type var)
vlax-vbArray
)
)
(not (zerop (VarArrayLen var)))
)
)

(defun VarArrayLen (var / array)
(setq array (vlax-variant-value var))
(- (vlax-safearray-get-u-bound array 1)
(vlax-safearray-get-l-bound array 1)
-1
)
)

(defun List->Coordinates (plist)
(vlax-make-variant
(vlax-safearray-fill
(vlax-make-safearray
vlax-vbDouble
(cons 0 (1- (* (length (car plist))
(length plist))))
)
(apply 'append plist)
)
)
)

(defun Coordinates->List (array dims / vlist rslt)
(if (eq (type array) 'variant)
(setq array (vlax-variant-value array))
)
(setq vlist (vlax-safearray->list array))
(if (eq dims 2)
(while vlist
(setq rslt
(cons
(list
(car vlist)
(cadr vlist)
)
rslt
)
vlist (cddr vlist)
)
)
(while vlist
(setq rslt
(cons
(list
(car vlist)
(cadr vlist)
(caddr vlist)
)
rslt
)
vlist (cdddr vlist)
)
)
)
(reverse rslt)
)

;; Generates a triangular mesh from selected AutoCAD POINT
;; entities. All points must lie in the XY plane.

(defun Celaunay2D ( / x ss points i p triangles)

(setq x *acadx*)
(setq ss (ssget '((0 . "POINT"))))
(if (zerop (sslength ss))
(exit)
)

(repeat (setq i (sslength ss))
(setq p (cdr (assoc 10
(entget
(ssname ss (setq i (1- i)))))))
(setq points
(cons
(list (car p) (cadr p))
points
)
)
)

(setq triangles
(coordinates->list
(vlax-invoke-method x
'Triangulate2d
(list->coordinates points)
)
3
)
)

(foreach triangle triangles
(gr-triangle triangle)
)
)

(defun gr-triangle (triangle / verts)
(setq verts
(mapcar
'(lambda (i)
(nth i points)
)
triangle
)
)
(grdraw (car verts) (cadr verts) 1)
(grdraw (cadr verts) (caddr verts) 1)
(grdraw (caddr verts) (car verts) 1)
)

;;;;;;;;;;;;;;;;;;; DELAUNAY2D.LSP ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Don't know how to fix it.

thanks

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Don't know why this lisp doesn't work
« Reply #1 on: March 23, 2011, 06:53:57 AM »
Quote
*Tony Tanzillo
.
Re: Copy of Tony Tanzillo's ACADX activex extension library
 2007-12-01 07:05 AM in reply to:gmyroup

 >> I am looking for a copy of Tony Tanzillo's ACADX activex extension.

AcadX is a copyrighted work that you cannot purchase
 a copy of. If you did manage to get your hands on a
 copy, and you distribute it, you will be facing a lawsuit.
 
Besides that, it's retired and does not work in any
release after 2006, and never will.
 
If you need something it offers, hire a programmer.
 


added :
http://forums.autodesk.com/t5/Visual-Basic-Customization/Copy-of-Tony-Tanzillo-s-ACADX-activex-extension-library/m-p/2125922/thread-id/85910
http://www.caddzone.com/acadx/
« Last Edit: March 23, 2011, 07:03:15 AM by Kerry »
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.

Brick_top

  • Guest
Re: Don't know why this lisp doesn't work
« Reply #2 on: March 23, 2011, 07:26:19 AM »
oh  :cry:

Thanks a lot for that info though

Lee Mac

  • Seagull
  • Posts: 12926
  • London, England
Re: Don't know why this lisp doesn't work
« Reply #3 on: March 23, 2011, 07:36:15 AM »
TT = Ledge

Brick_top

  • Guest
Re: Don't know why this lisp doesn't work
« Reply #4 on: March 23, 2011, 07:53:43 AM »

Ledge = Slang for Legend or Legendary

?

Lee Mac

  • Seagull
  • Posts: 12926
  • London, England
Re: Don't know why this lisp doesn't work
« Reply #5 on: March 23, 2011, 08:08:13 AM »
Ledge = Slang for Legend or Legendary

Indeed