VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

batch plot method?

10 REPLIES 10
Reply
Message 1 of 11
Anonymous
265 Views, 10 Replies

batch plot method?

I'm looking for advice and suggestions as to whether or not batch plotting with VBA is a good idea, or even practical? We don't necessarily have large plot jobs, most of our projects are 8-15 sheets in total. I have an old routine written that will allow the user to select files through the (dos_msgbox) - DosLib - and then process the returned list through a routine that will build a script file. This works great, BUT it requires that the file names and paths not have any spaces in them. Unfortunately, a great deal of our folders have spaces, and renaming them would be more of a pain because then all the pathed xref's get messed up. Anyway, I think that gives the picture of my delimma. Now, realizing that VBA will process paths w/ spaces in them. I was thinking of using my previous routine to create a TXT file rather than a SCR file, and then initiate a VBA routine that will process the file against a defined plot routine. Or are there different methods I could consider in regard to VBA? Thanks for any advice.
10 REPLIES 10
Message 2 of 11
Anonymous
in reply to: Anonymous

You should be able to handle spaces using lisp. I've done it many times. Could you post a sample part of the code that fails? Other than that VBA is a good choice for batch processing like plotting. For selecting the files you migth want to use GetOpenFileName function in comdlg32.dll. -- Best Regards, Jimmy Bergmark CAD and Database Developer Manager at www.pharmadule-emtunga.com Take a look at JTB FlexReport (FLEXlm report tool) - www.jtbworld.com/jtbflexreport SmartPurger (Purges automatically) - www.jtbworld.com/?/smartpurger.htm or download some freeware at www.jtbworld.com More on AutoCAD 2005; www.jtbworld.com/autocad2005.htm "Jason Wilder" wrote in message news:40a7b4a1_2@newsprd01... > I'm looking for advice and suggestions as to whether or not batch plotting > with VBA is a good idea, or even practical? > > We don't necessarily have large plot jobs, most of our projects are 8-15 > sheets in total. I have an old routine written that will allow the user to > select files through the (dos_msgbox) - DosLib - and then process the > returned list through a routine that will build a script file. This works > great, BUT it requires that the file names and paths not have any spaces in > them. Unfortunately, a great deal of our folders have spaces, and renaming > them would be more of a pain because then all the pathed xref's get messed > up. > > Anyway, I think that gives the picture of my delimma. Now, realizing that > VBA will process paths w/ spaces in them. I was thinking of using my > previous routine to create a TXT file rather than a SCR file, and then > initiate a VBA routine that will process the file against a defined plot > routine. > > Or are there different methods I could consider in regard to VBA? > > Thanks for any advice. > >
Message 3 of 11
Anonymous
in reply to: Anonymous

-- Matt W There are 3 kinds of people: Those who can count, and those who can't. "Jason Wilder" wrote in message news:40a7b4a1_2@newsprd01... > I'm looking for advice and suggestions as to whether or not batch plotting > with VBA is a good idea, or even practical? > > We don't necessarily have large plot jobs, most of our projects are 8-15 > sheets in total. I have an old routine written that will allow the user to > select files through the (dos_msgbox) - DosLib - and then process the > returned list through a routine that will build a script file. This works > great, BUT it requires that the file names and paths not have any spaces in > them. Unfortunately, a great deal of our folders have spaces, and renaming > them would be more of a pain because then all the pathed xref's get messed > up. > > Anyway, I think that gives the picture of my delimma. Now, realizing that > VBA will process paths w/ spaces in them. I was thinking of using my > previous routine to create a TXT file rather than a SCR file, and then > initiate a VBA routine that will process the file against a defined plot > routine. > > Or are there different methods I could consider in regard to VBA? > > Thanks for any advice. > >
Message 4 of 11
Anonymous
in reply to: Anonymous

Can you say "too much caffeine"??? Someone's a little "click-happy" this morning... If you put quotes around your file names, you should be able to process them with you batch plotting program. I.E. "C:\temp\long file name\first floor steel.dwg" -- Matt W There are 3 kinds of people: Those who can count, and those who can't. "Matt W" wrote in message news:40a8d1db$1_3@newsprd01... > > > -- > Matt W > > There are 3 kinds of people: > Those who can count, and those who can't. > > "Jason Wilder" wrote in message > news:40a7b4a1_2@newsprd01... > > I'm looking for advice and suggestions as to whether or not batch plotting > > with VBA is a good idea, or even practical? > > > > We don't necessarily have large plot jobs, most of our projects are 8-15 > > sheets in total. I have an old routine written that will allow the user > to > > select files through the (dos_msgbox) - DosLib - and then process the > > returned list through a routine that will build a script file. This works > > great, BUT it requires that the file names and paths not have any spaces > in > > them. Unfortunately, a great deal of our folders have spaces, and > renaming > > them would be more of a pain because then all the pathed xref's get messed > > up. > > > > Anyway, I think that gives the picture of my delimma. Now, realizing that > > VBA will process paths w/ spaces in them. I was thinking of using my > > previous routine to create a TXT file rather than a SCR file, and then > > initiate a VBA routine that will process the file against a defined plot > > routine. > > > > Or are there different methods I could consider in regard to VBA? > > > > Thanks for any advice. > > > > > >
Message 5 of 11
Anonymous
in reply to: Anonymous

Yes, LISP can handle the spaces, but it'd the SCR file that is the issue, not the LISP. "Jimmy Bergmark" wrote in message news:40a88014$1_3@newsprd01... > You should be able to handle spaces using lisp. I've done it many times. > Could you post a sample part of the code that fails? > Other than that VBA is a good choice for batch processing like plotting. > For selecting the files you migth want to use GetOpenFileName function in > comdlg32.dll. > > -- > Best Regards, Jimmy Bergmark > CAD and Database Developer Manager at www.pharmadule-emtunga.com > Take a look at > JTB FlexReport (FLEXlm report tool) - www.jtbworld.com/jtbflexreport > SmartPurger (Purges automatically) - www.jtbworld.com/?/smartpurger.htm > or download some freeware at www.jtbworld.com > More on AutoCAD 2005; > www.jtbworld.com/autocad2005.htm > > > "Jason Wilder" wrote in message > news:40a7b4a1_2@newsprd01... > > I'm looking for advice and suggestions as to whether or not batch plotting > > with VBA is a good idea, or even practical? > > > > We don't necessarily have large plot jobs, most of our projects are 8-15 > > sheets in total. I have an old routine written that will allow the user > to > > select files through the (dos_msgbox) - DosLib - and then process the > > returned list through a routine that will build a script file. This works > > great, BUT it requires that the file names and paths not have any spaces > in > > them. Unfortunately, a great deal of our folders have spaces, and > renaming > > them would be more of a pain because then all the pathed xref's get messed > > up. > > > > Anyway, I think that gives the picture of my delimma. Now, realizing that > > VBA will process paths w/ spaces in them. I was thinking of using my > > previous routine to create a TXT file rather than a SCR file, and then > > initiate a VBA routine that will process the file against a defined plot > > routine. > > > > Or are there different methods I could consider in regard to VBA? > > > > Thanks for any advice. > > > > > >
Message 6 of 11
Anonymous
in reply to: Anonymous

Um, mind refreshing my memory on how to add a quote - " - to each end of my path name and put that into a script file? "Matt W" wrote in message news:40a8d258_1@newsprd01... Can you say "too much caffeine"??? Someone's a little "click-happy" this morning... If you put quotes around your file names, you should be able to process them with you batch plotting program. I.E. "C:\temp\long file name\first floor steel.dwg" -- Matt W There are 3 kinds of people: Those who can count, and those who can't. "Matt W" wrote in message news:40a8d1db$1_3@newsprd01... > > > -- > Matt W > > There are 3 kinds of people: > Those who can count, and those who can't. > > "Jason Wilder" wrote in message > news:40a7b4a1_2@newsprd01... > > I'm looking for advice and suggestions as to whether or not batch plotting > > with VBA is a good idea, or even practical? > > > > We don't necessarily have large plot jobs, most of our projects are 8-15 > > sheets in total. I have an old routine written that will allow the user > to > > select files through the (dos_msgbox) - DosLib - and then process the > > returned list through a routine that will build a script file. This works > > great, BUT it requires that the file names and paths not have any spaces > in > > them. Unfortunately, a great deal of our folders have spaces, and > renaming > > them would be more of a pain because then all the pathed xref's get messed > > up. > > > > Anyway, I think that gives the picture of my delimma. Now, realizing that > > VBA will process paths w/ spaces in them. I was thinking of using my > > previous routine to create a TXT file rather than a SCR file, and then > > initiate a VBA routine that will process the file against a defined plot > > routine. > > > > Or are there different methods I could consider in regard to VBA? > > > > Thanks for any advice. > > > > > >
Message 7 of 11
Anonymous
in reply to: Anonymous

OPEN "X:\folder with space\file name with space.dwg" works in a script file if that is what you are after. -- Best Regards, Jimmy Bergmark CAD and Database Developer Manager at www.pharmadule-emtunga.com Take a look at JTB FlexReport (FLEXlm report tool) - www.jtbworld.com/jtbflexreport SmartPurger (Purges automatically) - www.jtbworld.com/?/smartpurger.htm or download some freeware at www.jtbworld.com More on AutoCAD 2005; www.jtbworld.com/autocad2005.htm "Jason Wilder" wrote in message news:40a8d2c6$1_2@newsprd01... > Yes, LISP can handle the spaces, but it'd the SCR file that is the issue, > not the LISP. > "Jimmy Bergmark" wrote in message > news:40a88014$1_3@newsprd01... > > You should be able to handle spaces using lisp. I've done it many times. > > Could you post a sample part of the code that fails? > > Other than that VBA is a good choice for batch processing like plotting. > > For selecting the files you migth want to use GetOpenFileName function in > > comdlg32.dll. > > > > -- > > Best Regards, Jimmy Bergmark > > CAD and Database Developer Manager at www.pharmadule-emtunga.com > > Take a look at > > JTB FlexReport (FLEXlm report tool) - www.jtbworld.com/jtbflexreport > > SmartPurger (Purges automatically) - www.jtbworld.com/?/smartpurger.htm > > or download some freeware at www.jtbworld.com > > More on AutoCAD 2005; > > www.jtbworld.com/autocad2005.htm > > > > > > "Jason Wilder" wrote in message > > news:40a7b4a1_2@newsprd01... > > > I'm looking for advice and suggestions as to whether or not batch > plotting > > > with VBA is a good idea, or even practical? > > > > > > We don't necessarily have large plot jobs, most of our projects are 8-15 > > > sheets in total. I have an old routine written that will allow the user > > to > > > select files through the (dos_msgbox) - DosLib - and then process the > > > returned list through a routine that will build a script file. This > works > > > great, BUT it requires that the file names and paths not have any spaces > > in > > > them. Unfortunately, a great deal of our folders have spaces, and > > renaming > > > them would be more of a pain because then all the pathed xref's get > messed > > > up. > > > > > > Anyway, I think that gives the picture of my delimma. Now, realizing > that > > > VBA will process paths w/ spaces in them. I was thinking of using my > > > previous routine to create a TXT file rather than a SCR file, and then > > > initiate a VBA routine that will process the file against a defined plot > > > routine. > > > > > > Or are there different methods I could consider in regard to VBA? > > > > > > Thanks for any advice. > > > > > > > > > > > >
Message 8 of 11
Anonymous
in reply to: Anonymous

it's been a while but I believe this will work... Note the sets of (3) quotes. (write-line (strcat """ LongFileName """) script-name) -- Matt W There are 3 kinds of people: Those who can count, and those who can't. "Jason Wilder" wrote in message news:40a8d3f3$1_3@newsprd01... Um, mind refreshing my memory on how to add a quote - " - to each end of my path name and put that into a script file? "Matt W" wrote in message news:40a8d258_1@newsprd01... Can you say "too much caffeine"??? Someone's a little "click-happy" this morning... If you put quotes around your file names, you should be able to process them with you batch plotting program. I.E. "C:\temp\long file name\first floor steel.dwg" -- Matt W There are 3 kinds of people: Those who can count, and those who can't. "Matt W" wrote in message news:40a8d1db$1_3@newsprd01... > > > -- > Matt W > > There are 3 kinds of people: > Those who can count, and those who can't. > > "Jason Wilder" wrote in message > news:40a7b4a1_2@newsprd01... > > I'm looking for advice and suggestions as to whether or not batch plotting > > with VBA is a good idea, or even practical? > > > > We don't necessarily have large plot jobs, most of our projects are 8-15 > > sheets in total. I have an old routine written that will allow the user > to > > select files through the (dos_msgbox) - DosLib - and then process the > > returned list through a routine that will build a script file. This works > > great, BUT it requires that the file names and paths not have any spaces > in > > them. Unfortunately, a great deal of our folders have spaces, and > renaming > > them would be more of a pain because then all the pathed xref's get messed > > up. > > > > Anyway, I think that gives the picture of my delimma. Now, realizing that > > VBA will process paths w/ spaces in them. I was thinking of using my > > previous routine to create a TXT file rather than a SCR file, and then > > initiate a VBA routine that will process the file against a defined plot > > routine. > > > > Or are there different methods I could consider in regard to VBA? > > > > Thanks for any advice. > > > > > >
Message 9 of 11
Anonymous
in reply to: Anonymous

Forget the last post... It needs to be "\"". I'm stuck in the world of VBA. Sorry... (defun C:ScriptTest ( / scrpt) (setq scrpt (open "e:/temp/script.scr" "w")) (write-line (strcat "\"" "Long file name" "\"") scrpt) (close scrpt) (princ) ) -- Matt W There are 3 kinds of people: Those who can count, and those who can't. "Matt W" wrote in message news:40a8d4dd_1@newsprd01... it's been a while but I believe this will work... Note the sets of (3) quotes. (write-line (strcat """ LongFileName """) script-name) -- Matt W There are 3 kinds of people: Those who can count, and those who can't. "Jason Wilder" wrote in message news:40a8d3f3$1_3@newsprd01... Um, mind refreshing my memory on how to add a quote - " - to each end of my path name and put that into a script file? "Matt W" wrote in message news:40a8d258_1@newsprd01... Can you say "too much caffeine"??? Someone's a little "click-happy" this morning... If you put quotes around your file names, you should be able to process them with you batch plotting program. I.E. "C:\temp\long file name\first floor steel.dwg" -- Matt W There are 3 kinds of people: Those who can count, and those who can't. "Matt W" wrote in message news:40a8d1db$1_3@newsprd01... > > > -- > Matt W > > There are 3 kinds of people: > Those who can count, and those who can't. > > "Jason Wilder" wrote in message > news:40a7b4a1_2@newsprd01... > > I'm looking for advice and suggestions as to whether or not batch plotting > > with VBA is a good idea, or even practical? > > > > We don't necessarily have large plot jobs, most of our projects are 8-15 > > sheets in total. I have an old routine written that will allow the user > to > > select files through the (dos_msgbox) - DosLib - and then process the > > returned list through a routine that will build a script file. This works > > great, BUT it requires that the file names and paths not have any spaces > in > > them. Unfortunately, a great deal of our folders have spaces, and > renaming > > them would be more of a pain because then all the pathed xref's get messed > > up. > > > > Anyway, I think that gives the picture of my delimma. Now, realizing that > > VBA will process paths w/ spaces in them. I was thinking of using my > > previous routine to create a TXT file rather than a SCR file, and then > > initiate a VBA routine that will process the file against a defined plot > > routine. > > > > Or are there different methods I could consider in regard to VBA? > > > > Thanks for any advice. > > > > > >
Message 10 of 11
Anonymous
in reply to: Anonymous

Thank you Matt. I had tried that, but it still didn't quite take, so I had asked in customization, and suggestion over there was to use (chr 34). Basically same as what you're showing, but I create a variable first. But you were right though, I needed the extra quotes, works nice now. Thanks! "Matt W" wrote in message news:40a8d5e1$1_3@newsprd01... Forget the last post... It needs to be "\"". I'm stuck in the world of VBA. Sorry... (defun C:ScriptTest ( / scrpt) (setq scrpt (open "e:/temp/script.scr" "w")) (write-line (strcat "\"" "Long file name" "\"") scrpt) (close scrpt) (princ) ) -- Matt W There are 3 kinds of people: Those who can count, and those who can't. "Matt W" wrote in message news:40a8d4dd_1@newsprd01... it's been a while but I believe this will work... Note the sets of (3) quotes. (write-line (strcat """ LongFileName """) script-name) -- Matt W There are 3 kinds of people: Those who can count, and those who can't. "Jason Wilder" wrote in message news:40a8d3f3$1_3@newsprd01... Um, mind refreshing my memory on how to add a quote - " - to each end of my path name and put that into a script file? "Matt W" wrote in message news:40a8d258_1@newsprd01... Can you say "too much caffeine"??? Someone's a little "click-happy" this morning... If you put quotes around your file names, you should be able to process them with you batch plotting program. I.E. "C:\temp\long file name\first floor steel.dwg" -- Matt W There are 3 kinds of people: Those who can count, and those who can't. "Matt W" wrote in message news:40a8d1db$1_3@newsprd01... > > > -- > Matt W > > There are 3 kinds of people: > Those who can count, and those who can't. > > "Jason Wilder" wrote in message > news:40a7b4a1_2@newsprd01... > > I'm looking for advice and suggestions as to whether or not batch plotting > > with VBA is a good idea, or even practical? > > > > We don't necessarily have large plot jobs, most of our projects are 8-15 > > sheets in total. I have an old routine written that will allow the user > to > > select files through the (dos_msgbox) - DosLib - and then process the > > returned list through a routine that will build a script file. This works > > great, BUT it requires that the file names and paths not have any spaces > in > > them. Unfortunately, a great deal of our folders have spaces, and > renaming > > them would be more of a pain because then all the pathed xref's get messed > > up. > > > > Anyway, I think that gives the picture of my delimma. Now, realizing that > > VBA will process paths w/ spaces in them. I was thinking of using my > > previous routine to create a TXT file rather than a SCR file, and then > > initiate a VBA routine that will process the file against a defined plot > > routine. > > > > Or are there different methods I could consider in regard to VBA? > > > > Thanks for any advice. > > > > > >
Message 11 of 11
Anonymous
in reply to: Anonymous

True, but I wasn't getting the quotes into the script file. That was the part I was missing. :D I've gotten the right syntax for my variable now, so I've got the path in quotes now like you show. Thanks Jimmy. "Jimmy Bergmark" wrote in message news:40a8d4de_2@newsprd01... > OPEN "X:\folder with space\file name with space.dwg" > works in a script file if that is what you are after. > > -- > Best Regards, Jimmy Bergmark > CAD and Database Developer Manager at www.pharmadule-emtunga.com > Take a look at > JTB FlexReport (FLEXlm report tool) - www.jtbworld.com/jtbflexreport > SmartPurger (Purges automatically) - www.jtbworld.com/?/smartpurger.htm > or download some freeware at www.jtbworld.com > More on AutoCAD 2005; > www.jtbworld.com/autocad2005.htm > > > "Jason Wilder" wrote in message > news:40a8d2c6$1_2@newsprd01... > > Yes, LISP can handle the spaces, but it'd the SCR file that is the issue, > > not the LISP. > > "Jimmy Bergmark" wrote in message > > news:40a88014$1_3@newsprd01... > > > You should be able to handle spaces using lisp. I've done it many times. > > > Could you post a sample part of the code that fails? > > > Other than that VBA is a good choice for batch processing like plotting. > > > For selecting the files you migth want to use GetOpenFileName function > in > > > comdlg32.dll. > > > > > > -- > > > Best Regards, Jimmy Bergmark > > > CAD and Database Developer Manager at www.pharmadule-emtunga.com > > > Take a look at > > > JTB FlexReport (FLEXlm report tool) - www.jtbworld.com/jtbflexreport > > > SmartPurger (Purges automatically) - www.jtbworld.com/?/smartpurger.htm > > > or download some freeware at www.jtbworld.com > > > More on AutoCAD 2005; > > > www.jtbworld.com/autocad2005.htm > > > > > > > > > "Jason Wilder" wrote in message > > > news:40a7b4a1_2@newsprd01... > > > > I'm looking for advice and suggestions as to whether or not batch > > plotting > > > > with VBA is a good idea, or even practical? > > > > > > > > We don't necessarily have large plot jobs, most of our projects are > 8-15 > > > > sheets in total. I have an old routine written that will allow the > user > > > to > > > > select files through the (dos_msgbox) - DosLib - and then process the > > > > returned list through a routine that will build a script file. This > > works > > > > great, BUT it requires that the file names and paths not have any > spaces > > > in > > > > them. Unfortunately, a great deal of our folders have spaces, and > > > renaming > > > > them would be more of a pain because then all the pathed xref's get > > messed > > > > up. > > > > > > > > Anyway, I think that gives the picture of my delimma. Now, realizing > > that > > > > VBA will process paths w/ spaces in them. I was thinking of using my > > > > previous routine to create a TXT file rather than a SCR file, and then > > > > initiate a VBA routine that will process the file against a defined > plot > > > > routine. > > > > > > > > Or are there different methods I could consider in regard to VBA? > > > > > > > > Thanks for any advice. > > > > > > > > > > > > > > > > > > > >

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost