Okay, it looks like we need a little explanation/tutorial/crystal ball to see through all of this stuff.
Let's start out with the contents of a simple XML file that holds AutoCAD Drawing Settings. The file name of this file will be dwgset.xml
<? xml version="1.0"?> <-- THIS LINE IS CRUCIAL!
<Settings> <-- Top level parent object -- only one per XML file.
<Layers>
<Layer Name="Walls" Color="2" LineType="continuous"/>
<Layer Name="Furniture" Color="3" LineType="HIDDEN"/>
</Layers>
<DrawingVars>
<RegenAuto>1</RegenAuto>
<EdgeMode>0</EdgeMode>
<Osmode>383</Osmode>
</DrawingVars>
</Settings>
Now that we have our XML file... Here are some code samples using the XML-API.vlx
(vl-load-com) ;; to make sure everything is peachy with Active-X
(load "xml-api.vlx") ;; load up the API
(setq oSettings (xml-Get-XMLObject "dwgset.xml")) ;; gets the settings element of the xml document object
(setq oLayers (xml-Get-Child oSettings nil "Layers")) ;; gets the Layers collection
(setq oRegen (xml-Get-Child oSettings "DrawingVars" "RegenAuto"))
;; to get the actual value of oRegen you can now use 'Text property as in
(vlax-get-property oRegen 'Text) ;; returns "1"
;; or you can get it this way...
(xml-Get-Child-Value oSettings "DrawingVars" "RegenAuto") ;; returns "1"
;; To get a Layer object with specific attribute name
(xml-Get-Child-ByAttribute oSettings "Layers" "Name" "Walls")
I hope you guys/gals/robots/etc. get the picture.
Here are a couple of things to be aware of when dealing with XML and VLISP
1. Everything fetched from an XML file is a string. You will have to post-process the info for type... It is possible to define what type of data is entered using XML Schema. But this API does not take that into account.
2. All text IS case sensitive when dealing with an XML file... the function names are not, but the data is.
I hope this can get y'all started. If you have any specific questions, please ask...
Mark, I don't mind. I put this out for all to enjoy. So whatever helps the most...