Author Topic: assign the plot output PDF file name, via VLISP  (Read 7564 times)

0 Members and 1 Guest are viewing this topic.

VovKa

  • Water Moccasin
  • Posts: 1626
  • Ukraine
Re: assign the plot output PDF file name, via VLISP
« Reply #15 on: January 18, 2021, 06:44:20 AM »
in few seconds, and with only with 1 (one) command !
that's what homos have been dreaming about for two million years :)

domenicomaria

  • Swamp Rat
  • Posts: 723
Re: assign the plot output PDF file name, via VLISP
« Reply #16 on: January 18, 2021, 09:25:17 AM »
that's what homos have been dreaming about for two million years :)
:laugh:

domenicomaria

  • Swamp Rat
  • Posts: 723
Re: assign the plot output PDF file name, via VLISP
« Reply #17 on: January 27, 2021, 09:49:43 AM »
But now, the SAME CODE doesn't work !

It says :
Automation Error. Description was not provided.

???

domenicomaria

  • Swamp Rat
  • Posts: 723
Re: assign the plot output PDF file name, via VLISP
« Reply #18 on: January 27, 2021, 10:07:07 AM »
Code - Auto/Visual Lisp: [Select]
  1. (defun VK_PLOTTOFILE    (ConfigName     MediaName Window FileName / AcadObj     ActiveDocObj ActiveLayoutObj PlotObj)
  2.         (setq   AcadObj                  (vlax-get-acad-object)
  3.                         ActiveDocObj     (vla-get-ActiveDocument AcadObj)
  4.                         ActiveLayoutObj (vla-get-ActiveLayout ActiveDocObj)
  5.         )
  6.         (vla-RefreshPlotDeviceInfo      ActiveLayoutObj                                         )
  7.         (vla-Put-ConfigName                             ActiveLayoutObj ConfigName                      )
  8.         (setq PlotObj                                           (vla-get-Plot ActiveDocObj)             )
  9.         (vla-Put-CanonicalMediaName     ActiveLayoutObj MediaName                       )
  10.  
  11.         (vla-put-UseStandardScale               ActiveLayoutObj :vlax-true                      )
  12.         (vla-Put-StandardScale                  ActiveLayoutObj 0.01                                    )
  13.  
  14.         (vla-put-PaperUnits                             ActiveLayoutObj acMillimeters           )
  15.         (vla-Put-PlotRotation                   ActiveLayoutObj ac0degrees                      )  
  16.         (vla-put-PlotOrigin ActiveLayoutObj     (vlax-make-variant (vlax-make-safearray vlax-vbDouble '(0 . 1) ) ) )
  17.         (vla-Put-CenterPlot ActiveLayoutObj :vlax-true)
  18.  
  19.         (vla-Put-PlotType ActiveLayoutObj acWindow) ; <<<<<<<<<<<
  20.         (vla-SetWindowToPlot ActiveLayoutObj
  21.                 (vlax-make-variant (vlax-safearray-fill (vlax-make-safearray vlax-vbDouble '(0 . 1) ) (car  Window) ) )
  22.                 (vlax-make-variant (vlax-safearray-fill (vlax-make-safearray vlax-vbDouble '(0 . 1) ) (cadr Window) ) )
  23.         )
  24.        
  25.         (vla-PlotToFile PlotObj FileName)
  26.         (foreach        o (list PlotObj ActiveLayoutObj ActiveDocObj AcadObj) (vlax-release-object o) )
  27. )
  28.  

(VK_PLOTTOFILE
   "AutoCAD PDF (High Quality Print).pc3"
   "ISO_full_bleed_A3_(420.00_x_297.00_MM)"
   (list (:PT3D2D plot-ll-pt) (:PT3D2D plot-ur-pt))
   pdf-full-file-name
)
(vla-Put-PlotType ActiveLayoutObj acWindow)
Automation Error. Invalid input

???
« Last Edit: January 27, 2021, 10:12:37 AM by domenicomaria »

Marc'Antonio Alessi

  • Swamp Rat
  • Posts: 1451
  • Marco
Re: assign the plot output PDF file name, via VLISP
« Reply #19 on: January 27, 2021, 10:11:22 AM »
Code: [Select]
  (vla-SetWindowToPlot
    ActiveLayoutObj
    (vlax-make-variant (vlax-safearray-fill (vlax-make-safearray vlax-vbDouble '(0 . 1)) (car Window)))
    (vlax-make-variant (vlax-safearray-fill (vlax-make-safearray vlax-vbDouble '(0 . 1)) (cadr Window)))
  )
:yes:

Marc'Antonio Alessi

  • Swamp Rat
  • Posts: 1451
  • Marco
Re: assign the plot output PDF file name, via VLISP
« Reply #20 on: January 27, 2021, 10:14:08 AM »
try again your previous code… (do not edit the message, post a new one)

domenicomaria

  • Swamp Rat
  • Posts: 723
Re: assign the plot output PDF file name, via VLISP
« Reply #21 on: January 27, 2021, 10:15:46 AM »
Marco, I don't understand whay you want mean !

Marc'Antonio Alessi

  • Swamp Rat
  • Posts: 1451
  • Marco
Re: assign the plot output PDF file name, via VLISP
« Reply #22 on: January 27, 2021, 10:16:18 AM »
See Vovka code:
Code: [Select]
  (vla-SetWindowToPlot
    ActiveLayoutObj
    (vlax-make-variant (vlax-safearray-fill (vlax-make-safearray vlax-vbDouble '(0 . 1)) (car Window)))
    (vlax-make-variant (vlax-safearray-fill (vlax-make-safearray vlax-vbDouble '(0 . 1)) (cadr Window)))
  )
  (vla-Put-PlotType ActiveLayoutObj acWindow)

Marc'Antonio Alessi

  • Swamp Rat
  • Posts: 1451
  • Marco
Re: assign the plot output PDF file name, via VLISP
« Reply #23 on: January 27, 2021, 10:18:26 AM »
Marco, I don't understand whay you want mean !
do not completely change a message you have already posted, make a new one otherwise we do not understand anything

domenicomaria

  • Swamp Rat
  • Posts: 723
Re: assign the plot output PDF file name, via VLISP
« Reply #24 on: January 27, 2021, 11:34:18 AM »
Quote
do not completely change a message you have already posted,
make a new one otherwise we do not understand anything
ok !

But however the situation is what is shown in the attached JPG . . .

Marc'Antonio Alessi

  • Swamp Rat
  • Posts: 1451
  • Marco
Re: assign the plot output PDF file name, via VLISP
« Reply #25 on: January 27, 2021, 11:40:20 AM »
Post this with your vaules:
Code - Auto/Visual Lisp: [Select]
  1. (PlotToFile "DWG To PDF.pc3"
  2.             "ANSI_A_(11.00_x_8.50_Inches)"
  3.             (list (list 0 0) (list 100 100))
  4.             (strcat (getvar "DWGPREFIX") (getvar "DWGNAME") ".pdf")
  5. )


EDIT (John): Added code tags.

domenicomaria

  • Swamp Rat
  • Posts: 723
Re: assign the plot output PDF file name, via VLISP
« Reply #26 on: January 27, 2021, 12:16:19 PM »
it's always the same!

In the image, it is well shown the code.

Where is the mistake ?

I checked my inputs . . . everything is right !


domenicomaria

  • Swamp Rat
  • Posts: 723
Re: assign the plot output PDF file name, via VLISP
« Reply #28 on: January 27, 2021, 12:26:09 PM »
I have FOUND the MISTAKE !

The FULL FILE NAME :

"D:\\[MIT]\\- MATERA - POLIZIA - 2018\\VIE di ESODO\\MT-QUESTURA - VIE di ESODO - PIANTA PIANO SEMINTERRATO - 01 - 180.pdf"

is TOO MUCH LONG !

Only This ! ! !

Marc'Antonio Alessi

  • Swamp Rat
  • Posts: 1451
  • Marco
Re: assign the plot output PDF file name, via VLISP
« Reply #29 on: January 27, 2021, 12:46:14 PM »
I asked to post the full command value...
For the error function see my previous post...
[size=78%]I am with my Android phone ....[/size]