tazzzz Posted August 1, 2016 Share Posted August 1, 2016 Hello, I have a LISP that used to work perfect until I switched to Acad2017. I installed the new Dos_lib for Acad2017 and I still get the same error: "error: no function definition:Dos_Multilist. Is there a way to achieve the same result without using Dos_lib or fixing this code to work with Acad2017? This is the code(created by Stefan BMR): (defun c:plotview ( / acobj acdoc views view_list) (setq acobj (vlax-get-acad-object) acdoc (vla-get-activedocument acobj) views (vla-get-views acdoc) ) (vlax-for view views (setq view_list (cons (vla-get-name view) view_list)) ) (foreach view (dos_multilist "PLOT SELECTED VIEWS" "Select views to plot" view_list) (command "_plot" "_y" "Model" "DWG To PDF.pc3" "ANSI A (11.00 x 8.50 Inches)" "Inches" "Landscape" "No" "View" view "Fit" "Center" "Yes" "ICP.ctb" "Yes" "A" (strcat (getvar 'dwgprefix) (vl-filename-base (getvar 'dwgname)) " - " view ".pdf") "No" "Yes" ) ) (princ) ) Thank you Quote Link to comment Share on other sites More sharing options...
Hippe013 Posted August 1, 2016 Share Posted August 1, 2016 Dos_Mulitlist still works in Acad2017. Two things that you will want to check. Is doslib loaded? Are you using the correct arx? For 2017 on a 64 bit machine it should be DOSLib21x64.arx I am currently using DosLib21x64 on Acad 2017 and it is working just fine. regards, Hippe013 Quote Link to comment Share on other sites More sharing options...
tazzzz Posted August 1, 2016 Author Share Posted August 1, 2016 Dos_lib is loaded and I use DOSLib21x64.arx on a 64 bit machine. Perhaps it's an issue with the lisp? Any ideas how to make this work are appreciated. Thank you Quote Link to comment Share on other sites More sharing options...
BIGAL Posted August 2, 2016 Share Posted August 2, 2016 Removed wrong idea Quote Link to comment Share on other sites More sharing options...
tazzzz Posted August 2, 2016 Author Share Posted August 2, 2016 Do you have a lisp(you can share)capable of doing the same thing ?: -showing views in model space -let you select the views that you want to plot Quote Link to comment Share on other sites More sharing options...
rlx Posted August 3, 2016 Share Posted August 3, 2016 (edited) I did write a plot lisp that also can plot views but it's relatively old and I'm not sure if all options work. Never quite finished it and probably could write some parts of the code much better by now , just not enough hours in a day... Anywayz , maybe it's usefull , at least the view part I hope. Once dialog has started (I hope) , go to advanced options and select view in the plot range section. gr. Rlx RLPlot.dcl RLPlot.LSP Edited August 3, 2016 by rlx Quote Link to comment Share on other sites More sharing options...
BIGAL Posted August 3, 2016 Share Posted August 3, 2016 Nice one RLX need extra to "Plot all tabs" "Plot range" Tazzz http://www.lee-mac.com/listbox.html this should replace the DOSLIB function. Quote Link to comment Share on other sites More sharing options...
rlx Posted August 3, 2016 Share Posted August 3, 2016 Nice one RLX need extra to "Plot all tabs" "Plot range" Tazzz http://www.lee-mac.com/listbox.html this should replace the DOSLIB function. Thanx Bigal... I really should finish it (one day) but looking on the bright side , company I'm working at moment has decided there's no more room for an engineerings department so end of this year I just might have all the time I need :-) gr.R. Quote Link to comment Share on other sites More sharing options...
tazzzz Posted August 3, 2016 Author Share Posted August 3, 2016 BIGAL, rlx thank you for your postings. Since I am still learning LISP , at this point I find it difficult to call Lee's function (and to replace dos_multilist). These are both programs and the small change I did: ;; created by Stefan BMR (defun c:plotview ( / acobj acdoc views view_list [color="red"]LISTBOX[/color]) (setq acobj (vlax-get-acad-object) acdoc (vla-get-activedocument acobj) views (vla-get-views acdoc) ) (vlax-for view views (setq view_list (cons (vla-get-name view) view_list)) ) (foreach view ([color="red"]LISTBOX[/color] "PLOT SELECTED VIEWS" "Select views to plot" view_list) (command "_plot" "_y" "Model" "DWG To PDF.pc3" "ARCH C (24.00 x 18.00 Inches)" "Inches" "Landscape" "No" "View" view "Fit" "Center" "Yes" "ICP.ctb" "Yes" "A" (strcat (getvar 'dwgprefix) (vl-filename-base (getvar 'dwgname)) " - " view ".pdf") "No" "Yes" ) ) (princ) ) ;;Created by Lee Mac ;; bit - [int] 1=allow multiple; 2=return indexes ;; Returns: [lst] List of selected items/indexes, else nil (defun LM:listbox ( msg lst bit / dch des tmp rtn ) (cond ( (not (and (setq tmp (vl-filename-mktemp nil nil ".dcl")) (setq des (open tmp "w")) (write-line (strcat "listbox:dialog{label=\"" msg "\";spacer;:list_box{key=\"list\";multiple_select=" (if (= 1 (logand 1 bit)) "true" "false") ";width=50;height=15;}spacer;ok_cancel;}" ) des ) (not (close des)) (< 0 (setq dch (load_dialog tmp))) (new_dialog "listbox" dch) ) ) (prompt "\nError Loading List Box Dialog.") ) ( t (start_list "list") (foreach itm lst (add_list itm)) (end_list) (setq rtn (set_tile "list" "0")) (action_tile "list" "(setq rtn $value)") (setq rtn (if (= 1 (start_dialog)) (if (= 2 (logand 2 bit)) (read (strcat "(" rtn ")")) (mapcar '(lambda ( x ) (nth x lst)) (read (strcat "(" rtn ")"))) ) ) ) ) ) (if (< 0 dch) (unload_dialog dch) ) (if (and tmp (setq tmp (findfile tmp))) (vl-file-delete tmp) ) rtn ) Hope someone will help me with this task Thank you Quote Link to comment Share on other sites More sharing options...
rlx Posted August 3, 2016 Share Posted August 3, 2016 try this : ;; created by Stefan BMR (defun c:plotview ( / acobj acdoc views view_list LISTBOX) (vl-load-com) (setq acobj (vlax-get-acad-object) acdoc (vla-get-activedocument acobj) views (vla-get-views acdoc) ) (vlax-for view views (setq view_list (cons (vla-get-name view) view_list)) ) (foreach view (LM:listbox "Select views to plot" view_list 1) (command "_plot" "_y" "Model" "DWG To PDF.pc3" "ARCH C (24.00 x 18.00 Inches)" "Inches" "Landscape" "No" "View" view "Fit" "Center" "Yes" "ICP.ctb" "Yes" "A" (strcat (getvar 'dwgprefix) (vl-filename-base (getvar 'dwgname)) " - " view ".pdf") "No" "Yes" ) ) (princ) ) ;;Created by Lee Mac ;; bit - [int] 1=allow multiple; 2=return indexes ;; Returns: [lst] List of selected items/indexes, else nil (defun LM:listbox ( msg lst bit / dch des tmp rtn ) (cond ( (not (and (setq tmp (vl-filename-mktemp nil nil ".dcl")) (setq des (open tmp "w")) (write-line (strcat "listbox:dialog{label=\"" msg "\";spacer;:list_box{key=\"list\";multiple_select=" (if (= 1 (logand 1 bit)) "true" "false") ";width=50;height=15;}spacer;ok_cancel;}" ) des ) (not (close des)) (< 0 (setq dch (load_dialog tmp))) (new_dialog "listbox" dch) ) ) (prompt "\nError Loading List Box Dialog.") ) ( t (start_list "list") (foreach itm lst (add_list itm)) (end_list) (setq rtn (set_tile "list" "0")) (action_tile "list" "(setq rtn $value)") (setq rtn (if (= 1 (start_dialog)) (if (= 2 (logand 2 bit)) (read (strcat "(" rtn ")")) (mapcar '(lambda ( x ) (nth x lst)) (read (strcat "(" rtn ")"))) ) ) ) ) ) (if (< 0 dch) (unload_dialog dch) ) (if (and tmp (setq tmp (findfile tmp))) (vl-file-delete tmp) ) rtn ) gr. Rlx Quote Link to comment Share on other sites More sharing options...
tazzzz Posted August 3, 2016 Author Share Posted August 3, 2016 This is it. Works like a charm. Thank you rlx. Quote Link to comment Share on other sites More sharing options...
rlx Posted August 3, 2016 Share Posted August 3, 2016 You're welcome and my thanx to BigAl and Lee gr.Rlx Quote Link to comment Share on other sites More sharing options...
BIGAL Posted August 4, 2016 Share Posted August 4, 2016 One little suggestion no need to live inside the view code. (if (not LM:listbox)(load "listboxV1-2")) (foreach view (LM:listbox "Select views to plot" view_list 1) Quote Link to comment Share on other sites More sharing options...
BrianTFC Posted February 28, 2018 Share Posted February 28, 2018 Rlx, Is there a way to modify this routine to where the user can pick the location of where the files are being saved instead of the source folder? Thanks, Brian Quote Link to comment Share on other sites More sharing options...
rlx Posted February 28, 2018 Share Posted February 28, 2018 Rlx, Is there a way to modify this routine to where the user can pick the location of where the files are being saved instead of the source folder? Thanks, Brian untested ;; created by Stefan BMR (defun c:plotview ( / acobj acdoc views view_list listbox folder) (vl-load-com) (setq acobj (vlax-get-acad-object) acdoc (vla-get-activedocument acobj) views (vla-get-views acdoc)) (vlax-for view views (setq view_list (cons (vla-get-name view) view_list))) (if (not (setq folder (getfolder "Select folder to save views"))) (setq folder (getvar 'dwgprefix))(setq folder (strcat folder "\\"))) (foreach view (LM:listbox "Select views to plot" view_list 1) (command "_plot" "_y" "Model" "DWG To PDF.pc3" "ARCH C (24.00 x 18.00 Inches)" "Inches" "Landscape" "No" "View" view "Fit" "Center" "Yes" "ICP.ctb" "Yes" "A" (strcat folder (vl-filename-base (getvar 'dwgname)) " - " view ".pdf") "No" "Yes"))(princ)) ;;Created by Lee Mac ;; bit - [int] 1=allow multiple; 2=return indexes ;; Returns: [lst] List of selected items/indexes, else nil (defun LM:listbox ( msg lst bit / dch des tmp rtn ) (cond ((not (and (setq tmp (vl-filename-mktemp nil nil ".dcl"))(setq des (open tmp "w")) (write-line (strcat "listbox:dialog{label=\"" msg "\";spacer;:list_box{key=\"list\";multiple_select=" (if (= 1 (logand 1 bit)) "true" "false") ";width=50;height=15;}spacer;ok_cancel;}" ) des) (not (close des))(< 0 (setq dch (load_dialog tmp)))(new_dialog "listbox" dch))) (prompt "\nError Loading List Box Dialog.")) (t (start_list "list") (foreach itm lst (add_list itm)) (end_list)(setq rtn (set_tile "list" "0")) (action_tile "list" "(setq rtn $value)") (setq rtn (if (= 1 (start_dialog)) (if (= 2 (logand 2 bit))(read (strcat "(" rtn ")")) (mapcar '(lambda ( x ) (nth x lst)) (read (strcat "(" rtn ")")))))))) (if (< 0 dch)(unload_dialog dch))(if (and tmp (setq tmp (findfile tmp))) (vl-file-delete tmp)) rtn ) (defun getfolder (msg / fl sh) (if (and (setq sh (vlax-create-object "Shell.Application"))(setq fl (vlax-invoke sh 'browseforfolder 0 msg 0 ""))) (setq fl (vlax-get-property (vlax-get-property fl 'self) 'path))(setq fl nil))(release_me (list sh)) fl) (defun release_me (lst) (mapcar '(lambda (x)(if (and (= 'vla-object (type x))(not (vlax-object-released-p x)))(vlax-release-object x))(set (quote x) nil)) lst)) gr. Rlx Quote Link to comment Share on other sites More sharing options...
BrianTFC Posted February 28, 2018 Share Posted February 28, 2018 RLX, It works Great thank you!!!!!! Brian Quote Link to comment Share on other sites More sharing options...
BIGAL Posted March 1, 2018 Share Posted March 1, 2018 Our pdf's are hard coded to go one level below the dwg location so everyone knows where to look this is check for directory if not exist make it. ; check that pdf directory exists (setq dwgpre (strcat (getvar "dwgprefix") "\pdf")) (if (= (vl-file-directory-p dwgpre) nil) (vl-mkdir dwgpre) ) Quote Link to comment Share on other sites More sharing options...
BrianTFC Posted March 2, 2018 Share Posted March 2, 2018 Rlx, Is there a way to combine the PDF's in this lisp into one document without using a third party program like Publish does? Thanks, Brian Quote Link to comment Share on other sites More sharing options...
rlx Posted March 2, 2018 Share Posted March 2, 2018 Rlx, Is there a way to combine the PDF's in this lisp into one document without using a third party program like Publish does? Thanks, Brian now I come to think about it , good question , could use this myself. Haven't checked this out yet but will try monday : http://www.cadtutor.net/forum/showthread.php?97827-Plot-to-PDF-and-Combine-into-one-file http://www.cadtutor.net/forum/showthread.php?96713-PDF-Combine-Software although Roy_043 talks about ghostscript and I'm not sure I can use that because on my work IT has a competition who can block the most options. gr. Rlx Quote Link to comment Share on other sites More sharing options...
Grrr Posted March 2, 2018 Share Posted March 2, 2018 Heres a subfoo to merge pdf files, through adobe acrobat. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.