I've been doing some research about parsing XML with AutoCAD, and I'm having some difficulty. I think it may be because I'm using ACAD2004, but I could be way off. I'm using the following code:
I've tried stepping through the code one line at a time, and find that the second line (vlax-invoke-method...) returns :vlax-false. Nothing works after that. Anybody have any ideas? Before you ask, I did type the directory and filename correctly. I even tried placing the file in the AutoCAD search path, and I tried using the findfile lisp function. It always returns :vlax-false no matter what I do.Code:(setq doc (vla-getinterfaceobject (vlax-get-acad-object) "MSXML.DOMDocument")) (vlax-invoke-method doc 'Load "C:\\Temp\\myxmlfile.xml") (setq nodes (vlax-get-property doc 'childNodes)) (setq node (vlax-get-property nodes 'Item 0)) (vlax-dump-object node)
I'm not sure if 2004 even supports using the XML DOM. Did AutoDesk not start supporting this functionality untilI a later release? I realize that I could use VBA or I could parse INI files with VLISP. But I'd really like to use VLISP and XML if possible. Thanks.