<?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: AutoLISP DWGToPDF: bad argument type: VLA-OBJECT nil in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-dwgtopdf-bad-argument-type-vla-object-nil/m-p/12916742#M11248</link>
    <description>&lt;P&gt;&lt;FONT size="3"&gt;Has the script worked in the past?&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 24 Jul 2024 10:49:19 GMT</pubDate>
    <dc:creator>pbejse</dc:creator>
    <dc:date>2024-07-24T10:49:19Z</dc:date>
    <item>
      <title>AutoLISP DWGToPDF: bad argument type: VLA-OBJECT nil</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-dwgtopdf-bad-argument-type-vla-object-nil/m-p/12915682#M11247</link>
      <description>&lt;P&gt;Im trying to set up Design Automation for AutoCAD. After submitting the work item I get a response saying it was successful. But when I look at the logs it seems to have trouble running the script&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;AutoCAD menu utilities loaded.
[07/23/2024 23:02:54] Command:
[07/23/2024 23:02:54] Command: Enter BACKSPACE to interrupt script.
[07/23/2024 23:02:54] Command:
[07/23/2024 23:02:54] Command: (load "DWGToPDF.lsp")
[07/23/2024 23:02:54] C:DWGTOPDF
[07/23/2024 23:02:54] Command: (c:DWGToPDF)
[07/23/2024 23:02:54] ; error: bad argument type: VLA-OBJECT nil
[07/23/2024 23:02:55] End AutoCAD Core Engine standard output dump.
[07/23/2024 23:02:55] Error: AutoCAD Core Console output contains error(s).
[07/23/2024 23:02:55] End script phase.&lt;/LI-CODE&gt;&lt;P&gt;Am I doing something wrong in my script?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="lisp"&gt;(defun c:DWGToPDF()
  (vl-load-com)

  ; Suppress file dialog boxes
  (setq originalFileDia (getvar "FILEDIA"))
  (setvar "FILEDIA" 0)

  ; Get the active document in AutoCAD
  (setq doc (vla-get-ActiveDocument (vlax-get-acad-object)))

  ; Check if the document is valid
  (if (null doc)
    (progn
      (princ "\nError: No active document found.")
      (exit)
    )
  )

  ; Get the full path of the active document
  (setq docPath (vlax-get-property doc 'FullName))

  ; Extract the directory path from the full path
  (setq outputDir (vl-filename-directory docPath))

  ; Get the Layouts collection
  (setq layouts (vla-get-Layouts doc))

  ; List to store output PDF file paths
  (setq outputFiles '())

  ; Iterate through all layouts
  (vlax-for layout layouts
    (setq layoutName (vla-get-Name layout))
    
    ; Skip the "Model" layout
    (if (/= layoutName "Model")
      (progn
        ; Print the name of the current layout for debugging
        (princ (strcat "\nProcessing layout: " layoutName "\n"))

        ; Generate the output file path
        (setq sanitizedLayoutName (vl-string-translate "/\\:*?\"&amp;lt;&amp;gt;|" "_" layoutName))
        (setq outputFile (strcat outputDir "\\" sanitizedLayoutName ".pdf"))
        (princ (strcat "\nOutput file path: " outputFile "\n"))

        ; Add to output files list
        (setq outputFiles (cons outputFile outputFiles))

        ; Start the plot command
        (command
          "-plot"                                   ; Start the plot command
          "Yes"                                     ; Detailed plot configuration
          layoutName                                ; Layout name
          "DWG To PDF.pc3"                          ; Output device name
          "ARCH full bleed E1 (30.00 x 42.00 Inches)"; Paper size
          "inches"                                  ; Paper units (default)
          "Landscape"                               ; Drawing orientation
          "No"                                      ; Plot upside down?
          "Extents"                                 ; Plot area
          "Fit"                                     ; Plot scale
          "0,0"                                  ; Plot offset (centered)
          "Yes"                                     ; Plot with plot styles?
          ""                          ; Plot style table name
          "Yes"                                     ; Plot with lineweights?
          "Yes"                                     ; Scale lineweights with plot scale?
          "No"                                      ; Plot paper space last
          "No"                                      ; Hide plot
          outputFile                                ; Output file name
          "No"                                      ; Prompt for plot details
          "No"                                     ; Save changes to layout
        )
      )
    )
  )

  ; Reset FILEDIA variable to original state
  (setvar "FILEDIA" originalFileDia)

  ; Print completion message
  (princ "\nPlotting complete.\n")

  ; Print output files for Design Automation to recognize
  (foreach file outputFiles
    (princ (strcat "\nOutput file: " file "\n"))
  )

  (princ)
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2024 23:19:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-dwgtopdf-bad-argument-type-vla-object-nil/m-p/12915682#M11247</guid>
      <dc:creator>adonispaz3G2GB</dc:creator>
      <dc:date>2024-07-23T23:19:36Z</dc:date>
    </item>
    <item>
      <title>Re: AutoLISP DWGToPDF: bad argument type: VLA-OBJECT nil</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-dwgtopdf-bad-argument-type-vla-object-nil/m-p/12916742#M11248</link>
      <description>&lt;P&gt;&lt;FONT size="3"&gt;Has the script worked in the past?&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2024 10:49:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-dwgtopdf-bad-argument-type-vla-object-nil/m-p/12916742#M11248</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2024-07-24T10:49:19Z</dc:date>
    </item>
    <item>
      <title>Re: AutoLISP DWGToPDF: bad argument type: VLA-OBJECT nil</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-dwgtopdf-bad-argument-type-vla-object-nil/m-p/12916842#M11249</link>
      <description>&lt;P&gt;Maybe you need to run script through ACAD session and not through CoreConsole... And BTW, can we see script file (*.scr)...&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2024 11:39:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-dwgtopdf-bad-argument-type-vla-object-nil/m-p/12916842#M11249</guid>
      <dc:creator>marko_ribar</dc:creator>
      <dc:date>2024-07-24T11:39:22Z</dc:date>
    </item>
    <item>
      <title>Re: AutoLISP DWGToPDF: bad argument type: VLA-OBJECT nil</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-dwgtopdf-bad-argument-type-vla-object-nil/m-p/12916964#M11250</link>
      <description>&lt;P&gt;The vla functions most likely are not supported with accoreconsole. Even (layoutlist) function is not supported. This the &lt;A href="https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/layoutlist-function/m-p/3798539/highlight/true#M309653" target="_blank" rel="noopener"&gt;workaround&lt;/A&gt; to cycle through layouts in accoreconsolle&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun GetLayoutListACoreConsole ()
 (defun massoc (key alist / x nlist)
  (foreach x alist
   (if (eq key (car x))
    (setq nlist (cons (cdr x) nlist))
   )
  )
  (reverse nlist)
 )
 (massoc 3 (dictsearch(namedobjdict)"acad_layout"))
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2024 12:37:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-dwgtopdf-bad-argument-type-vla-object-nil/m-p/12916964#M11250</guid>
      <dc:creator>paullimapa</dc:creator>
      <dc:date>2024-07-24T12:37:00Z</dc:date>
    </item>
    <item>
      <title>Re: AutoLISP DWGToPDF: bad argument type: VLA-OBJECT nil</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-dwgtopdf-bad-argument-type-vla-object-nil/m-p/12917013#M11251</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1137264"&gt;@paullimapa&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;The vla functions most likely are not supported with &lt;STRONG&gt;accoreconsole&lt;/STRONG&gt;. Even (layoutlist) function is not supported.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/940934"&gt;@marko_ribar&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Maybe you need to run script through ACAD session and not through&lt;STRONG&gt; CoreConsole&lt;/STRONG&gt;... And BTW, can we see script file (*.scr)...&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT size="3"&gt;I did not even consider that Design Automation use&amp;nbsp;&lt;STRONG&gt;accoreconsole&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Good one&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1137264"&gt;@paullimapa&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/940934"&gt;@marko_ribar&lt;/a&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2024 12:56:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-dwgtopdf-bad-argument-type-vla-object-nil/m-p/12917013#M11251</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2024-07-24T12:56:57Z</dc:date>
    </item>
    <item>
      <title>Re: AutoLISP DWGToPDF: bad argument type: VLA-OBJECT nil</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-dwgtopdf-bad-argument-type-vla-object-nil/m-p/12917047#M11252</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/564264"&gt;@pbejse&lt;/a&gt;&amp;nbsp;Just reading the output from OP:&lt;/P&gt;&lt;PRE&gt;[07/23/2024 23:02:55] Error: AutoCAD Core Console output contains error(s).&lt;/PRE&gt;&lt;PRE&gt;[07/23/2024 23:02:55] End AutoCAD Core Engine standard output dump.&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2024 13:10:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-dwgtopdf-bad-argument-type-vla-object-nil/m-p/12917047#M11252</guid>
      <dc:creator>paullimapa</dc:creator>
      <dc:date>2024-07-24T13:10:12Z</dc:date>
    </item>
    <item>
      <title>Re: AutoLISP DWGToPDF: bad argument type: VLA-OBJECT nil</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-dwgtopdf-bad-argument-type-vla-object-nil/m-p/12917071#M11253</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1137264"&gt;@paullimapa&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/564264"&gt;@pbejse&lt;/a&gt;&amp;nbsp;Just reading the output from OP:&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;FONT size="3"&gt;You are right, I've been away too long&amp;nbsp;&lt;/FONT&gt;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2024 13:14:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-dwgtopdf-bad-argument-type-vla-object-nil/m-p/12917071#M11253</guid>
      <dc:creator>CLL_PBE</dc:creator>
      <dc:date>2024-07-24T13:14:09Z</dc:date>
    </item>
    <item>
      <title>Re: AutoLISP DWGToPDF: bad argument type: VLA-OBJECT nil</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-dwgtopdf-bad-argument-type-vla-object-nil/m-p/12917767#M11254</link>
      <description>&lt;P&gt;Yes this script has always worked locally. But now im trying to get it to work on Design Automation which has yet to work.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2024 18:35:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-dwgtopdf-bad-argument-type-vla-object-nil/m-p/12917767#M11254</guid>
      <dc:creator>adonispaz3G2GB</dc:creator>
      <dc:date>2024-07-24T18:35:05Z</dc:date>
    </item>
    <item>
      <title>Re: AutoLISP DWGToPDF: bad argument type: VLA-OBJECT nil</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-dwgtopdf-bad-argument-type-vla-object-nil/m-p/12917824#M11255</link>
      <description>This was it right here. I had to re-write my entire AutoLISP script to not use VLA functions and replaced layoutlist with the workaround &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1137264"&gt;@paullimapa&lt;/a&gt; provided. Thank you very much!</description>
      <pubDate>Wed, 24 Jul 2024 19:14:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-dwgtopdf-bad-argument-type-vla-object-nil/m-p/12917824#M11255</guid>
      <dc:creator>adonispaz3G2GB</dc:creator>
      <dc:date>2024-07-24T19:14:23Z</dc:date>
    </item>
    <item>
      <title>Re: AutoLISP DWGToPDF: bad argument type: VLA-OBJECT nil</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-dwgtopdf-bad-argument-type-vla-object-nil/m-p/12917873#M11256</link>
      <description>&lt;P&gt;glad to have helped...cheers!!!&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2024 19:33:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-dwgtopdf-bad-argument-type-vla-object-nil/m-p/12917873#M11256</guid>
      <dc:creator>paullimapa</dc:creator>
      <dc:date>2024-07-24T19:33:32Z</dc:date>
    </item>
    <item>
      <title>Re: AutoLISP DWGToPDF: bad argument type: VLA-OBJECT nil</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-dwgtopdf-bad-argument-type-vla-object-nil/m-p/12918604#M11257</link>
      <description>&lt;P&gt;Just tried it is there a problem that the list includes "Model" ? It just requires a workaround checking layout name or if Model is always last, just use (repeat (- (length nlist) 1) so does not call "Model". Or just remove "Model" from nlist as part of defun.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2024 04:56:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-dwgtopdf-bad-argument-type-vla-object-nil/m-p/12918604#M11257</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2024-07-25T04:56:23Z</dc:date>
    </item>
    <item>
      <title>Re: AutoLISP DWGToPDF: bad argument type: VLA-OBJECT nil</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-dwgtopdf-bad-argument-type-vla-object-nil/m-p/12918627#M11258</link>
      <description>&lt;P&gt;exactly&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2024 05:18:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/autolisp-dwgtopdf-bad-argument-type-vla-object-nil/m-p/12918627#M11258</guid>
      <dc:creator>paullimapa</dc:creator>
      <dc:date>2024-07-25T05:18:55Z</dc:date>
    </item>
  </channel>
</rss>

