Visual LISP, AutoLISP and General Customization
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
*andrew.nao
PDF prints to wrong dir.
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
164 Views, 3 Replies
05-19-2010 07:42 AM
Hello folks,
hoping someone might have a solution for this that maybe im not seeing.
this lisp code is supposed to write a dwg to a pdf in the same directory as
the dwg
sometimes it works sometimes it doesn't, more doesn't then does.
does anyone see why it wouldn't save to the same directory as the dwg
any help is appreciated
[code]
(defun printpdf (/ fileloc filenam)
(setq fileloc (strcat (getvar "dwgprefix") (vl-filename-base (getvar
"dwgname"))))
(setq filenam (vl-filename-base (getvar "dwgname")))
(command "-plot""y" "" "DWG To PDF.pc3" "ANSI expand A (8.50 x 11.00
Inches)" "I" "P" "N" "E" "F" "" "Y" "nao.ctb" "Y" "" filenam
"n" "y")
)
[\code]
hoping someone might have a solution for this that maybe im not seeing.
this lisp code is supposed to write a dwg to a pdf in the same directory as
the dwg
sometimes it works sometimes it doesn't, more doesn't then does.
does anyone see why it wouldn't save to the same directory as the dwg
any help is appreciated
[code]
(defun printpdf (/ fileloc filenam)
(setq fileloc (strcat (getvar "dwgprefix") (vl-filename-base (getvar
"dwgname"))))
(setq filenam (vl-filename-base (getvar "dwgname")))
(command "-plot""y" "" "DWG To PDF.pc3" "ANSI expand A (8.50 x 11.00
Inches)" "I" "P" "N" "E" "F" "" "Y" "nao.ctb" "Y" "" filenam
"n" "y")
)
[\code]
*Gert
Re: PDF prints to wrong dir.
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
05-19-2010 08:04 AM in reply to:
*andrew.nao
maybe its a problem, if the file already exists
you could
(vl-file-delete filenam)
i guess it doesn´t crash, if the file does not exist
and the filenam should be
(setq FILENAM (strcat (getvar "DWGPREFIX") (vl-filename-base (getvar
"DWGNAME"))))
andrew.nao wrote:
> Hello folks,
> hoping someone might have a solution for this that maybe im not seeing.
> this lisp code is supposed to write a dwg to a pdf in the same directory as
> the dwg
> sometimes it works sometimes it doesn't, more doesn't then does.
>
> does anyone see why it wouldn't save to the same directory as the dwg
> any help is appreciated
>
> [code]
> (defun printpdf (/ fileloc filenam)
> (setq fileloc (strcat (getvar "dwgprefix") (vl-filename-base (getvar
> "dwgname"))))
> (setq filenam (vl-filename-base (getvar "dwgname")))
>
> (command "-plot""y" "" "DWG To PDF.pc3" "ANSI expand A (8.50 x 11.00
> Inches)" "I" "P" "N" "E" "F" "" "Y" "nao.ctb" "Y" "" filenam
> "n" "y")
> )
> [\code]
you could
(vl-file-delete filenam)
i guess it doesn´t crash, if the file does not exist
and the filenam should be
(setq FILENAM (strcat (getvar "DWGPREFIX") (vl-filename-base (getvar
"DWGNAME"))))
andrew.nao wrote:
> Hello folks,
> hoping someone might have a solution for this that maybe im not seeing.
> this lisp code is supposed to write a dwg to a pdf in the same directory as
> the dwg
> sometimes it works sometimes it doesn't, more doesn't then does.
>
> does anyone see why it wouldn't save to the same directory as the dwg
> any help is appreciated
>
> [code]
> (defun printpdf (/ fileloc filenam)
> (setq fileloc (strcat (getvar "dwgprefix") (vl-filename-base (getvar
> "dwgname"))))
> (setq filenam (vl-filename-base (getvar "dwgname")))
>
> (command "-plot""y" "" "DWG To PDF.pc3" "ANSI expand A (8.50 x 11.00
> Inches)" "I" "P" "N" "E" "F" "" "Y" "nao.ctb" "Y" "" filenam
> "n" "y")
> )
> [\code]
*Gert
Re: PDF prints to wrong dir.
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
05-19-2010 08:08 AM in reply to:
*andrew.nao
ups sorry
(setq FILENAME (strcat (getvar "DWGPREFIX) (substr (getvar "DWGNAME") 1
(- (strlen (getvar "DWGNAME")) 4))))
Gert wrote:
> maybe its a problem, if the file already exists
> you could
> (vl-file-delete filenam)
> i guess it doesn´t crash, if the file does not exist
> and the filenam should be
> (setq FILENAM (strcat (getvar "DWGPREFIX") (vl-filename-base (getvar
> "DWGNAME"))))
>
>
> andrew.nao wrote:
>
>>Hello folks,
>>hoping someone might have a solution for this that maybe im not seeing.
>>this lisp code is supposed to write a dwg to a pdf in the same directory as
>>the dwg
>>sometimes it works sometimes it doesn't, more doesn't then does.
>>
>>does anyone see why it wouldn't save to the same directory as the dwg
>>any help is appreciated
>>
>>[code]
>>(defun printpdf (/ fileloc filenam)
>>(setq fileloc (strcat (getvar "dwgprefix") (vl-filename-base (getvar
>>"dwgname"))))
>>(setq filenam (vl-filename-base (getvar "dwgname")))
>>
>>(command "-plot""y" "" "DWG To PDF.pc3" "ANSI expand A (8.50 x 11.00
>>Inches)" "I" "P" "N" "E" "F" "" "Y" "nao.ctb" "Y" "" filenam
>>"n" "y")
>>)
>>[\code]
>
>
(setq FILENAME (strcat (getvar "DWGPREFIX) (substr (getvar "DWGNAME") 1
(- (strlen (getvar "DWGNAME")) 4))))
Gert wrote:
> maybe its a problem, if the file already exists
> you could
> (vl-file-delete filenam)
> i guess it doesn´t crash, if the file does not exist
> and the filenam should be
> (setq FILENAM (strcat (getvar "DWGPREFIX") (vl-filename-base (getvar
> "DWGNAME"))))
>
>
> andrew.nao wrote:
>
>>Hello folks,
>>hoping someone might have a solution for this that maybe im not seeing.
>>this lisp code is supposed to write a dwg to a pdf in the same directory as
>>the dwg
>>sometimes it works sometimes it doesn't, more doesn't then does.
>>
>>does anyone see why it wouldn't save to the same directory as the dwg
>>any help is appreciated
>>
>>[code]
>>(defun printpdf (/ fileloc filenam)
>>(setq fileloc (strcat (getvar "dwgprefix") (vl-filename-base (getvar
>>"dwgname"))))
>>(setq filenam (vl-filename-base (getvar "dwgname")))
>>
>>(command "-plot""y" "" "DWG To PDF.pc3" "ANSI expand A (8.50 x 11.00
>>Inches)" "I" "P" "N" "E" "F" "" "Y" "nao.ctb" "Y" "" filenam
>>"n" "y")
>>)
>>[\code]
>
>
*andrew.nao
Re: PDF prints to wrong dir.
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
05-20-2010 05:40 AM in reply to:
*andrew.nao
thanks for your reply
I got it working
I got it working
