Mystogan Posted October 2 Posted October 2 Hello Everyone, I’ve recently started researching ActiveX, DXF, and Visual Lisp, and I’m currently using The Visual Lisp Developer Bible by David Stein as a reference. I encountered a small issue and was hoping someone might be able to assist me. When using the name "sa," everything works fine, but when I try using a different name, I receive an error. Specially using the myarray, mat2 and sa(in string type) Any help or guidance would be greatly appreciated! See attached image on autocad command line Thank you in advance. PS: some of the sample I did is came with this link https://help.autodesk.com/view/ACDLT/2025/ENU/?guid=GUID-7C2331B4-1A4D-40FF-B59A-D35F7942936B Quote
Steven P Posted October 2 Posted October 2 Not sure here but do you need to define myarray or mat2 as lists before you can use them (setq myarray (list)) Quote
Mystogan Posted October 2 Author Posted October 2 Hi stevenP Thank you for taking time for my thread. Actually as per my reference the output should be for mat2 using the (vlax-saferray->list mat2) result/ouput should be (("a" "b" "c") ("d" "e" "f")) But on my command line the output for mat2 is ; error: bad argument I don't know why didn't get the same result with the reference. Quote
marko_ribar Posted October 2 Posted October 2 (edited) I get this lines correctly in BricsCAD V23 : : (setq mat2 (vlax-make-safearray vlax-vbString '(0 . 1) '(1 . 3))) #<safearray...> : (vlax-safearray-fill mat2 '(("a" "b" "c") ("d" "e" "f"))) #<safearray...> : (vlax-safearray->list mat2) (("a" "b" "c") ("d" "e" "f")) And in AutoCAD 2022 : Command: (setq mat2 (vlax-make-safearray vlax-vbString '(0 . 1) '(1 . 3))) #<safearray...> Command: (vlax-safearray-fill mat2 '(("a" "b" "c") ("d" "e" "f"))) #<safearray...> Command: (vlax-safearray->list mat2) (("a" "b" "c") ("d" "e" "f")) Edited October 2 by marko_ribar Quote
Mystogan Posted October 3 Author Posted October 3 This kind a weird, it is now working. I don't know what went wrong as you may see in the attach file Quote
Steven P Posted October 3 Posted October 3 A bit of a guess here.... yesterday (?) you asked and today it is magically fixed after restarting the computer overnight and restarting CAD... might be that you need to localise your variables and yesterday it was picking up values you were using elsewhere? That is my number 1 cause of something working today that didn't work yesterday 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.