As someone that is not familiar with AutoLisp, I am inferring AutoLisp doesn't have many other data structures besides lists?
I thought I read earlier in the thread that a point was (xx yy zz), how would a BlockTableRecord be represented in AutoLisp?
Is it a list of its properties & methods?
Others were faster and probably explained better, still leaving my impressions (may worth something) :
It has primitive data types, like: int, string, real, null, list, symbol, subroutine, userSubroutine
(INT REAL STR
nil LIST SYM SUBR USUBR
)
VL-CATCH-ALL-APPLY-ERROR
But VLISP can offer access to acad's object model (COM).. so you still work with the built-in properties/methods, access the built-in objects
and there are additional datatypes such as: variant, safearray, vla-object.
However you can't create your own custom objects.
Also there are few ways to call the methods, with the
(<vla>-MethodName <vla-object> args)
or
(vlax-invoke <vla-object> 'MethodName args)
or
(vlax-invoke-method <vla-object> 'MethodName args)Where in some you can provide the vanilla lisp representation of point, as a list of x/y/z numbers
but others require conversion with the built-in activex lisp function
vlax-3d-point,
so it converts that list of '(x y z) into a variant of array of doubles with a value of safearray of doubles, that holds the x y z.
(setq pt '
(10.0 20.5 5.2)) ; bound our point into a list of x y z
; Few ways to call the same method that does the same thing:
(vlax-invoke CurrentSpace 'AddPoint pt
) ; #1 uses vanilla-lisp data as argument for the point (vla-AddPoint CurrentSpace
(vlax-3d-point pt
)) ; #2 converting the vanilla lisp point into a variant via (vlax-3D-point) function [required] ; #3 manual converting, to a variant data for 3D point [required]:
pt
)
(+ vlax-vbArray vlax-vbDouble)
)
)
; investigating what returns (vlax-3D-point) / or how it converts the input (thats how I came up with #3)
8197
; https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2016/ENU/AutoCAD-AutoLISP/files/GUID-14029CC8-2839-432B-ABFC-F470AFA7606B-htm.html
_$ (+ vlax-vbArray vlax-vbDouble)
8197
; hence:
_$
(= (+ vlax
-vbArray
vlax-vbDouble) (vlax
-variant
-type (vlax-3d-point '
(10.0 20.5 5.2))))T
(10.0 20.5 5.2)