Keywordkid Posted September 11, 2012 Share Posted September 11, 2012 I've tried going back to basics by creating a default installation and exporting clean fresh Profiles for AutoCAD 2012 and verified there is something amiss with my custom setup! Everything looks good and seems to load up ok but I get a Fatal error every time I try to plot a DWF using the OOTB .PC3's (just renamed). Initially I thought there was something wrong with my arg file but I am now suspecting it's something to do with the combination lsp/scr files I'm running. Using an exported OOTB profile I changed one support path to direct it to my local version and thereby be able to run my startup.scr. Here are my customisations: Startup script- (vl-load-com) (defun c:SetOrMakeUserWs (/ wsTemplate _WsCurrent user) ;; Change this string to be the name of the standard ;; workspace to be copied as the user workspace: (setq wsTemplate "Default") ;; _WsCurrent sub-function: (defun _WsCurrent (workspace) (if (vl-catch-all-error-p (vl-catch-all-apply 'setvar (list 'wscurrent workspace) ) ) nil T ) ) ;; ;; Main code: ;; ;; If you cannot set the user's workspace current ;; (meaining it does not exist) (if (not (_WsCurrent (setq user (getvar 'loginname)))) ;; Attempt to set the template workspace current (if (_WsCurrent wsTemplate) ;;(_WsCurrent wsTemplate) (progn ;; If successful, save the template workspace ;; as the user workspace (command "._wssave" user) ;; Now that the user workspace exists, set ;; it current (_WsCurrent user) (command "._workspace" "delete" "Default" "y") ) ) ) ;;(command "._workspace" "delete" "Default" "y") (princ) ) (c:SetOrMakeUserWs) Followed by: ACAD.lsp ;;############################### ;; Set registry file search paths ;;############################### (setenv "SaveFilePath" (strcat "C:\\ACAD\\"(getvar "loginname"))) (setenv "LogFilePath" (strcat "C:\\ACAD\\"(getvar "loginname"))) (setenv "ActRecPath" (strcat "C:\\ACAD\\"(getvar "loginname"))) (setenv "ActRecPath" (strcat "C:\\ACAD\\"(getvar "loginname"))) (setenv "PlotLogPath" (strcat "C:\\ACAD\\"(getvar "loginname"))) (setenv "ACADDRV" "C:\\Program Files\\Autodesk\\AutoCAD 2012 - English\\drv") (setenv "EnterpriseMenuFile" "c:\\acad\\ACAD-2012-LOCAL\\support\\SWD-Default.cuix") (setenv "QnewTemplate" "c:\\acad\\ACAD-2012-LOCAL\\template\\SWD2012.dwt") (setenv "PrinterConfigDir" "C:\\ACAD\\ACAD-2012-LOCAL\\02-Plotters") (setenv "PrinterStyleSheetDir" "C:\\ACAD\\ACAD-2012-LOCAL\\02-Plotters\\plot styles") (setenv "PrinterDescDir" "C:\\ACAD\\ACAD-2012-LOCAL\\02-Plotters\\pmp files") (princ) (vl-load-com) ;; This sets a reference to the files portion of the acad preferences (setq *files* (vla-get-files (vla-get-preferences (vlax-get-acad-object)) )) ;; This builds the string of support file search paths (setq sfsp (strcat "C:\\ACAD\\"(getvar "loginname")"[url="file://\\support"]\\support[/url];" "C:\\ACAD\\ACAD-2012-LOCAL\\03-Fonts;" "C:\\ACAD\\ACAD-2012-LOCAL\\04-CTB-Files;" "C:\\ACAD\\ACAD-2012-LOCAL\\05-AutoCAD Pattern Files;" "C:\\ACAD\\ACAD-2012-LOCAL\\support;" "C:\\ACAD\\ACAD-2012-LOCAL\\support\\color;" "C:\\ACAD\\ACAD-2012-LOCAL\\Express;" ) ) ;; This actually applies the above string to the current session of AutoCAD. (vla-put-SupportPath *files* sfsp) ;; Release the object (vlax-release-object *files*) (command "Menu" (strcat "c:\\acad\\"(getvar "loginname")"[url="file://\\support\\mymenu.cuix"]\\support\\mymenu.cuix[/url]")) (princ) And then: ACADDOC.lsp ; Create usernamed temporary folder on local drive in c:\temp (command "shell" "md c:\\ACAD\\%username%") (princ) ; Run .bat to create user's Acad directories ;(command "shell" "md W:\\CADWorkspace\\00-SWD\\00-Cad-Management\\NEW-CAD-USER.bat") ;(princ) ; Merge Registry settings for username variables and default user temp files ;(command "shell" "reg import c:\\ACAD\\ACAD-2012-local\\SWD-2012.reg") (command "shell" "C:\\ACAD\\ACAD-2012-LOCAL\\autoload.bat") (princ) ; Set registry file search paths (setenv "SaveFilePath" (strcat "C:\\ACAD\\"(getvar "loginname"))) (setenv "LogFilePath" (strcat "C:\\ACAD\\"(getvar "loginname"))) (setenv "ActRecPath" (strcat "C:\\ACAD\\"(getvar "loginname"))) (setenv "TempDirectory" (strcat "C:\\ACAD\\"(getvar "loginname"))) (princ) I hope someone can spot why my DWF printing is causing such an issue, let me know if I should include my arg file too. Many thanks, Mark. Quote Link to comment Share on other sites More sharing options...
Lee Roy Posted September 11, 2012 Share Posted September 11, 2012 Why are you renaming the OOTB .pc3's? Any time I've tried that, I've gotten errors. Quote Link to comment Share on other sites More sharing options...
Keywordkid Posted September 12, 2012 Author Share Posted September 12, 2012 The renaming makes no difference, the originals fatal error too but only with my custom settings! Plus I named them in numbered fashion for tidiness. Quote Link to comment Share on other sites More sharing options...
Keywordkid Posted September 12, 2012 Author Share Posted September 12, 2012 I can now verify the problem lies solely with my ARG file but I have no idea how to fix it. The problem was compounded by my shell command running a batch file to merge the current ARG into the registry (an attempt to implement a roaming profile scenario rather than the last used registry setting), I have disabled this for the time being. What I can't work out is: when I have a working session and try to create a new 'Default' ARG by exporting it out, merging this fresh ARG file into the registry causes the Fatal error on plotting DWF's to return. The newly exported ARG is 66k in size whilst the Working one is 75k. I have tried reviewing the two files on a comparison site but I am struggling to identify the cause and why such differences are occurring. I'd appreciate any suggestions on what may be going wrong, I'll attach the two files if anyone would like to interrogate them (SWD-Default is the working ARG and ..clean is the resulting export) and maybe see a glaring error that I can't. Cheers, Mark. NB: I changed the args to txt as the uploader wasn't seeing them SWD-USER-clean.txt SWD-Default.txt 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.