Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Setting Multiple Plotter Locations

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
smbrennan
566 Views, 6 Replies

Setting Multiple Plotter Locations

Before I start, I'll begin by saying I'm just starting to dig into AutoLISP. And by dig in, I mean I haven't programmed in 14 years, and at that point it was an Intro to C++. I rememebr enough to understand some basics, but not much beyond that.

 

Ok, so here's the issue:

 

I am working on some basic LISP routines to help automate startups and support paths for the company (only 10 CAD users).  One of the issues I'm trying to solve is for the users that have laptops. They often go to job sites, and require a different set of PC3 files than within the office. The workflow I think would work (again, I'm just getting started), is using acad.lsp file to run a series of other batch and lisp routines. One .lsp is dedicated to the plotter support paths.

 

I am trying to accomodate the laptop users by giving them basically 2 plotter config locations - one on the server for all the "in house" plotting, and one on their local drive for the "jobsite" plotting. Here's what my code looks like:

 

(setenv "PrinterConfigDir" "X:\\CADD\\Plotters" "C:\\CADD\\Plotters")
(setenv "PrinterStyleSheetDir" "X:\\CADD\\Plot Styles" "C:\\CADD\\Plot Styles")
(setenv "PrinterDescDir" "X:\\CADD\\Plotters\\PMP Files" "C:\\CADD\\Plotters\\PMP")

It appears that the second path (local) is replacing the first path (server). 

 

How can I have this routine add two paths for each of the settings?

 

Thanks in advance,

Shawn

 

Shawn B.

      |   
To help improve Autodesk Products, please Click Here to Vote for ideas and submit your own.
6 REPLIES 6
Message 2 of 7
Shneuph
in reply to: smbrennan

Instead of passing 2 separate strings try putting the paths together with a semicolon inbetween like:

 

(setenv "PrinterConfigDir" "X:\\CADD\\Plotters;C:\\CADD\\Plotters")
---sig---------------------------------------
'(83 104 110 101 117 112 104 64 71 109 97 105 108 46 99 111 109)
Message 3 of 7
rkmcswain
in reply to: smbrennan

Using the method described here, a semicolon between the paths works. I can't speak for using (setenv)

 

Example:

;; Example of setting two paths, the second path here is just C:\

;; Set path for plotters
(vla-put-PrinterConfigPath *myFiles* (strcat SERVER_NAME "\\CAD\\AutoCADPrinters;c:\\"))

;; Set path for plot styles
(vla-put-PrinterStyleSheetPath *myFiles* (strcat SERVER_NAME "\\CAD\\PLOT STYLES;c:\\"))

;; Set path for printer Descriptions
(vla-put-PrinterDescPath *myFiles* (strcat SERVER_NAME "\\CAD\\AutoCADPrinters\\PMP FILES;c:\\"))

 

R.K. McSwain     | CADpanacea | on twitter
Message 4 of 7
Shneuph
in reply to: rkmcswain

Setenv should do the trick. Just remember that it is writing to the registry and they 'key' is case sensitive.

 

(setenv "PrinterConfigDir" "X:\\CADD\\Plotters;C:\\CADD\\Plotters")

---sig---------------------------------------
'(83 104 110 101 117 112 104 64 71 109 97 105 108 46 99 111 109)
Message 5 of 7
smbrennan
in reply to: Shneuph

Thanks for the information guys. The semi-colon worked.

This does bring a couple of questions though. First, what's the difference between the vla-put and setenv? Doing a single search, I found this, but not much else:
http://forums.autodesk.com/t5/Visual-LISP-AutoLISP-and-General/pros-and-cons-of-setenv-and-vla-put/t...

My second question, could you please elaborate, or link me to somewhere that explains the case-sensitivity topic? I have noticed in my support paths I sometimes saw duplicates because of capitalized folder names (as they are on the file server and local machine), but the duplicate value almost appeared as the previous session's set, but in lower-case form. The paths are exactly the same, just different capitalization.

Thanks,
Shawn
Shawn B.

      |   
To help improve Autodesk Products, please Click Here to Vote for ideas and submit your own.
Message 6 of 7
rkmcswain
in reply to: smbrennan

1.
(setenv) is a function to set environment variables. Very limited to what can and can't be modified this way.

The (vla-....) functions are acting on object properties. The hierarchical object tree in this case is AutoCAD > Preferences > Files >

2.
The only thing case sensitive is the environment variable name itself. Paths should not matter, not sure why there would be a duplicate. WIndows O/S, more specifically, NTFS, is not case-sensitive although it remembers the file/foldername case.




R.K. McSwain     | CADpanacea | on twitter
Message 7 of 7
Shneuph
in reply to: smbrennan

http://docs.autodesk.com/ACD/2011/ENU/filesALR/WS1a9193826455f5ff1a32d8d10ebc6b7ccc-6956.htmRegistryEnvVars.png

---sig---------------------------------------
'(83 104 110 101 117 112 104 64 71 109 97 105 108 46 99 111 109)

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

Post to forums  

Autodesk Design & Make Report

”Boost