How programmatically set the plot stamp file reference...? Through registry?
OK, I found short way of duing the ... same think (?) (defun PlotStampFile ( / ref key val) (and (setq ref (findfile "Inches.pss")) (dos_attrib ref 8) ;_You should have doslibXX installed or you can ignore this line ... but if the file will have read-only property it cannot be accessed for further modifications; this is a small-small bug in AutoCAD. (setq key (strcat "HKEY_CURRENT_USER\\" (vlax-product-key) "\\Profiles\\" (getvar "CPROFILE") "\\Dialogs\\Plot Stamp")) (setq val (vl-registry-descendents key "")) (setq val (car (member "PSPFilename" val))) (vl-registry-write key val ref)) )
I wouldn't call that a bug, small-small or otherwise. When I set a .pss file to read-only status, I like the fact that AutoCAD recognizes this and doesn't even allow the user to touch the settings within AutoCAD. It's a nice way to keep the plotstamp consistent throughout a department or company. If it did allow the user to save changes to a read-only .pss, the read-only setting would be rather pointless.
Provided the .pss file is writable, you can also configure it with Autolisp by walking through the plotstamp settings like you would on the command line. Here's some simple code I use to set the plot stamp. It accepts a value for the offset setting so that it can be changed depending on which printer is be used when this routine is called. The same thing could be done for any of the other settings by replacing their values with variables: (defun pltstmpset (offsetit /) (command "-plotstamp" "o" "f" "y" "n" "y" "y" "n" "n" "n" "loc" "bl" "v" "n" offsetit "a" "") )
I have two comments to your suggestions: 1. The Read-Only property: Plot stamp shouldn't be any read-only, it should always be normal or archived. Anyone can change this attribute through properties dialog. If some office whish to keep this file out of unauthorized access there are better ways of doing this; keeping this file in a protected-office-standards folder. By default this file is in Support folder and in most cased people just overwrite properties to this file. 2. The command line option: a) Command line option does not have a plot stamp file reference to set. b) When use command line option (for other settings) make sure the file is not read only, otherwise with the command sequence you posted you will get <Unknown command "o" ...> prompts, because the command sequence in read only case is different and you cannot check that difference but checking the file read only state. Autolisp by walking through the plotstamp settings like you would on the command line. Here's some simple code I use to set the plot stamp. It accepts a value for the offset setting so that it can be changed depending
I use Express Tools Rtext and it work great! To include the directory path with the file name: Drawing name: $(getvar, "dwgprefix")$(getvar, "dwgname") Output: Drawing file: C:\Projects\97-102\Arch\102-fp12.dwg
"Plot stamp shouldn't be any read-only, it should always be normal or archived. Anyone can change this attribute through properties dialog. If some office whish to keep this file out of unauthorized access there are better ways of doing this; keeping this file in a protected-office-standards folder. By default this file is in Support folder and in most cased people just overwrite properties to this file." The the various departments I support in my company each need to use a consistent plot stamp. Individual user modification is neither necessary nor desired. I find that making the plot-stamp read-only is an elegantly simple solution for this situation. I keep the read-only pss file in a specific configuration folder on the local drive of each user along with dozens of other support files (pc3, pmp, ctb, lsp, dcl, dll, lin, shx, etc.) that are customized for each department. (Keeping the files local reduces network traffic and increases system responsiveness.) The users' AutoCAD profiles are set to look to this folder for these configuration files rather than the support folder. That way, it's much easier to keep track of them and swap out some or all of them with a bat or lsp when a department's configuration needs to be updated. In order to allow the user to perform such an update when necessary, they need write access to the folder in question. And this is why I set the pss file to read-only status within that folder rather than making the whole folder protected.
"Plot stamp shouldn't be any read-only, it should always be normal or archived. Anyone can change this attribute through properties dialog. If some office whish to keep this file out of unauthorized access there are better ways of doing this; keeping this file in a protected-office-standards folder. By default this file is in Support folder and in most cased people just overwrite properties to this file." The various departments that I support in my company each need to use a consistent plot stamp. User modification is neither necessary nor desired. I keep most of the modified configuration files (pc3, pmp, ctb, dll, lsp, dcl, etc.) for AutoCAD locally on each workstation in a separate configuration folder rather than the support folder, with the profile set to look to this folder for these files. Keeping them local reduces network traffic and increases system responsiveness. Keeping them all in a single folder separate from the support folder makes it easier to swap out some or all of them with a bat or lsp when a department's configuration needs to be updated. In order for a user to use such a lsp or bat, they need to have write access to this folder. So protecting the whole folder with read-only permissions is not practical. Thus I set the pss file to read-only status within that folder to protect it from accidental modification by the users.