<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Lisp to export layers to KML/KMZ seperately in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-export-layers-to-kml-kmz-seperately/m-p/9713207#M70904</link>
    <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/8877434"&gt;@wian.meier&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What does your command history say when you run your lisp?&lt;/P&gt;</description>
    <pubDate>Wed, 26 Aug 2020 15:34:54 GMT</pubDate>
    <dc:creator>CodeDing</dc:creator>
    <dc:date>2020-08-26T15:34:54Z</dc:date>
    <item>
      <title>Lisp to export layers to KML/KMZ seperately</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-export-layers-to-kml-kmz-seperately/m-p/9712975#M70903</link>
      <description>&lt;P&gt;Good day all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've written a LISP for AutoCAD Map 3d, but I can't seem to get the export to work correctly. I can correctly export all the layers to separate shape/Tab files, but not KML.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Am I using the command wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun c:test (/ file nam lst table)
(vlax-for lyr
(vla-get-layers
(vla-get-activedocument
(vlax-get-acad-object)
)
)
(setq table (cons (vla-get-name lyr) table))
)
(setq file (LM:browseforfolder "Select a folder" "C:\\" 0))

(while 
	(setq lst (car table))
	(setq nam (strcat file "\\" lst))
	(command ".-mapexport" "OGCKML" nam "_N" "_S" "_ALL" lst "*" "_N" "_Proceed")
	(setq table (cdr table))
)

)

;; Browse for Folder  -  Lee Mac
;; Displays a dialog prompting the user to select a folder.
;; msg - [str] message to display at top of dialog
;; dir - [str] [optional] root directory (or nil)
;; bit - [int] bit-coded flag specifying dialog display settings
;; Returns: [str] Selected folder filepath, else nil.
 
(defun LM:browseforfolder ( msg dir bit / err fld pth shl slf )
    (setq err
        (vl-catch-all-apply
            (function
                (lambda ( / app hwd )
                    (if (setq app (vlax-get-acad-object)
                              shl (vla-getinterfaceobject app "shell.application")
                              hwd (vl-catch-all-apply 'vla-get-hwnd (list app))
                              fld (vlax-invoke-method shl 'browseforfolder (if (vl-catch-all-error-p hwd) 0 hwd) msg bit dir)
                        )
                        (setq slf (vlax-get-property fld 'self)
                              pth (vlax-get-property slf 'path)
                              pth (vl-string-right-trim "\\" (vl-string-translate "/" "\\" pth))
                        )
                    )
                )
            )
        )
    )
    (if slf (vlax-release-object slf))
    (if fld (vlax-release-object fld))
    (if shl (vlax-release-object shl))
    (if (vl-catch-all-error-p err)
        (prompt (vl-catch-all-error-message err))
        pth
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2020 13:54:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-export-layers-to-kml-kmz-seperately/m-p/9712975#M70903</guid>
      <dc:creator>wian.meier</dc:creator>
      <dc:date>2020-08-26T13:54:15Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp to export layers to KML/KMZ seperately</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-export-layers-to-kml-kmz-seperately/m-p/9713207#M70904</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/8877434"&gt;@wian.meier&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What does your command history say when you run your lisp?&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2020 15:34:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-export-layers-to-kml-kmz-seperately/m-p/9713207#M70904</guid>
      <dc:creator>CodeDing</dc:creator>
      <dc:date>2020-08-26T15:34:54Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp to export layers to KML/KMZ seperately</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-export-layers-to-kml-kmz-seperately/m-p/9713226#M70905</link>
      <description>&lt;P&gt;This is what my command history shows, only 2 of the layers have blocks drawn in, the rest of the layers are empty.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Command: TEST
.-mapexport Enter file type to export to, or ? for list &amp;lt;OGCKML&amp;gt;:OGCKML Enter name of file to create &amp;lt;C:\Test\0&amp;gt;:C:\Test\5m 100 125 pole Load Profile? [Yes/No] &amp;lt;No&amp;gt;:_N Change options  [Selection/Data/Options/Proceed] &amp;lt;Proceed&amp;gt;:_S Select objects for export [All/Manually] &amp;lt;All&amp;gt;:_ALL Enter name(s) of layer(s) to filter for objects or ? for list &amp;lt;*&amp;gt;:5m 100 125 pole Enter name(s) of class(es) to filter for objects or ? for list &amp;lt;*&amp;gt;:* Export Polygon Toplogy? [Yes/No]  &amp;lt;No&amp;gt;:_N Change options  [Selection/Data/Options/Proceed] &amp;lt;Proceed&amp;gt;:_Proceed Processing...
"4 object(s) of 4 selected, exported in 0 sec(s).
Command: .-mapexport Enter file type to export to, or ? for list &amp;lt;OGCKML&amp;gt;:OGCKML Enter name of file to create &amp;lt;C:\Test\5m 100 125 pole&amp;gt;:C:\Test\5m 150 175 pole Load Profile? [Yes/No] &amp;lt;No&amp;gt;:_N Change options  [Selection/Data/Options/Proceed] &amp;lt;Proceed&amp;gt;:_S Select objects for export [All/Manually] &amp;lt;All&amp;gt;:_ALL Enter name(s) of layer(s) to filter for objects or ? for list &amp;lt;*&amp;gt;:5m 150 175 pole Enter name(s) of class(es) to filter for objects or ? for list &amp;lt;*&amp;gt;:* Export Polygon Toplogy? [Yes/No]  &amp;lt;No&amp;gt;:_N Change options  [Selection/Data/Options/Proceed] &amp;lt;Proceed&amp;gt;:_Proceed Processing...
"4 object(s) of 4 selected, exported in 0 sec(s).
Command: .-mapexport Enter file type to export to, or ? for list &amp;lt;OGCKML&amp;gt;:OGCKML Enter name of file to create &amp;lt;C:\Test\5m 150 175 pole&amp;gt;:C:\Test\4F Aerial Load Profile? [Yes/No] &amp;lt;No&amp;gt;:_N Change options  [Selection/Data/Options/Proceed] &amp;lt;Proceed&amp;gt;:_S Select objects for export [All/Manually] &amp;lt;All&amp;gt;:_ALL Enter name(s) of layer(s) to filter for objects or ? for list &amp;lt;*&amp;gt;:4F Aerial Enter name(s) of class(es) to filter for objects or ? for list &amp;lt;*&amp;gt;:* Export Polygon Toplogy? [Yes/No]  &amp;lt;No&amp;gt;:_N Change options  [Selection/Data/Options/Proceed] &amp;lt;Proceed&amp;gt;:_Proceed Processing...
"0 object(s) of 0 selected, exported in 0 sec(s).
Command: .-mapexport Enter file type to export to, or ? for list &amp;lt;OGCKML&amp;gt;:OGCKML Enter name of file to create &amp;lt;C:\Test\4F Aerial&amp;gt;:C:\Test\Defpoints Load Profile? [Yes/No] &amp;lt;No&amp;gt;:_N Change options  [Selection/Data/Options/Proceed] &amp;lt;Proceed&amp;gt;:_S Select objects for export [All/Manually] &amp;lt;All&amp;gt;:_ALL Enter name(s) of layer(s) to filter for objects or ? for list &amp;lt;*&amp;gt;:Defpoints Enter name(s) of class(es) to filter for objects or ? for list &amp;lt;*&amp;gt;:* Export Polygon Toplogy? [Yes/No]  &amp;lt;No&amp;gt;:_N Change options  [Selection/Data/Options/Proceed] &amp;lt;Proceed&amp;gt;:_Proceed Processing...
"0 object(s) of 0 selected, exported in 0 sec(s).
Command: .-mapexport Enter file type to export to, or ? for list &amp;lt;OGCKML&amp;gt;:OGCKML Enter name of file to create &amp;lt;C:\Test\Defpoints&amp;gt;:C:\Test\0 Load Profile? [Yes/No] &amp;lt;No&amp;gt;:_N Change options  [Selection/Data/Options/Proceed] &amp;lt;Proceed&amp;gt;:_S Select objects for export [All/Manually] &amp;lt;All&amp;gt;:_ALL Enter name(s) of layer(s) to filter for objects or ? for list &amp;lt;*&amp;gt;:0 Enter name(s) of class(es) to filter for objects or ? for list &amp;lt;*&amp;gt;:* Export Polygon Toplogy? [Yes/No]  &amp;lt;No&amp;gt;:_N Change options  [Selection/Data/Options/Proceed] &amp;lt;Proceed&amp;gt;:_Proceed Processing...
"0 object(s) of 0 selected, exported in 0 sec(s).&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2020 15:43:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-export-layers-to-kml-kmz-seperately/m-p/9713226#M70905</guid>
      <dc:creator>wian.meier</dc:creator>
      <dc:date>2020-08-26T15:43:28Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp to export layers to KML/KMZ seperately</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-export-layers-to-kml-kmz-seperately/m-p/9713264#M70906</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/8877434"&gt;@wian.meier&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you. If I am interpreting correctly, you are saying that you are getting 2 KML files but you are expecting 5?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2020 16:00:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-export-layers-to-kml-kmz-seperately/m-p/9713264#M70906</guid>
      <dc:creator>CodeDing</dc:creator>
      <dc:date>2020-08-26T16:00:46Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp to export layers to KML/KMZ seperately</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-export-layers-to-kml-kmz-seperately/m-p/9713275#M70907</link>
      <description>&lt;P&gt;I'm expecting only 2, but the problem is these files can't be opened in google earth. When I look at the file size of the KML/KMZ it is 1kb regardless of how many objects are placed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It doesn't seem to be exporting the layers correctly. When I manually export the layers with&lt;/P&gt;&lt;LI-CODE lang="general"&gt;_mapexport&lt;/LI-CODE&gt;&lt;P&gt;it works perfectly&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See the attached image&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2020 16:08:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-export-layers-to-kml-kmz-seperately/m-p/9713275#M70907</guid>
      <dc:creator>wian.meier</dc:creator>
      <dc:date>2020-08-26T16:08:46Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp to export layers to KML/KMZ seperately</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-export-layers-to-kml-kmz-seperately/m-p/9713314#M70908</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/8877434"&gt;@wian.meier&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you post one of the KMZ files? I would like to see what is in it when I extract / open it with Notepad.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;--Edit--&lt;/P&gt;&lt;P&gt;Better yet,&amp;nbsp;&lt;STRONG&gt;IF&lt;/STRONG&gt; you can upload a copy of the dwg file you're having issues with, I can see if the error duplicates when I try the same process.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;~DD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2020 16:32:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-export-layers-to-kml-kmz-seperately/m-p/9713314#M70908</guid>
      <dc:creator>CodeDing</dc:creator>
      <dc:date>2020-08-26T16:32:45Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp to export layers to KML/KMZ seperately</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-export-layers-to-kml-kmz-seperately/m-p/9713336#M70909</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) Maybe a "stupid" remark !?&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;2) Have you tested your DWG (+ your Lisp) with a standard/classic filename for your DWG ?&lt;/P&gt;
&lt;P&gt;Please ONLY : A-Z , 0-9 , - , _&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3) NO Space/Blank or ANY special cars !&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;THE HEALTH (Stay Safe), Regards, Patrice&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2020 16:37:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-export-layers-to-kml-kmz-seperately/m-p/9713336#M70909</guid>
      <dc:creator>braudpat</dc:creator>
      <dc:date>2020-08-26T16:37:41Z</dc:date>
    </item>
  </channel>
</rss>

