MSasu Posted May 10, 2012 Share Posted May 10, 2012 When I inserted the first command and hit return it brought up the command line again. Subsequently with the next two commands I received a "T" on the command line after each command. The first line loaded the VisualLISP extension; the behaviour is the expected one. The next two lines confirms that the folders are available, but the files seems to be missing. Can you load again, one by one, the lines from post #12? Quote Link to comment Share on other sites More sharing options...
MSasu Posted May 10, 2012 Share Posted May 10, 2012 Sorry, what are you wanting me to do next? I am not a programmer just a humble tech. Sorry, that was an answer at Lee Mac's observation. Quote Link to comment Share on other sites More sharing options...
nativedog Posted May 10, 2012 Author Share Posted May 10, 2012 When I hit return the mirro image of the path is displayed minus the double forward slash which is the normal single. Quote Link to comment Share on other sites More sharing options...
MSasu Posted May 10, 2012 Share Posted May 10, 2012 That means that the files are in fact available on the said paths. Sorry, I realy don't know now where else the error can be - I'll have to think about this. Quote Link to comment Share on other sites More sharing options...
nativedog Posted May 10, 2012 Author Share Posted May 10, 2012 That's OK. I need to get back on the job. I will check back again tomorrow or later today if there are anymore posts. Thanks for trying to help. Quote Link to comment Share on other sites More sharing options...
MSasu Posted May 10, 2012 Share Posted May 10, 2012 By the way, do you know the origin of this code? I mean, who written it. Maybe you can contact that person for a better debug. Quote Link to comment Share on other sites More sharing options...
BlackBox Posted May 10, 2012 Share Posted May 10, 2012 AFAIK, when adding directories to the AutoCAD Support Path list, only the specified directory is searched, no subfolders beneath the directory will be searched - you would need to add the required subfolder paths to the Support Path list separately. ... Unless one adds the subfolder as a prefix to the string argument, which holds true for both the Load, and Findfile functions. (load "[color=red]SubFolderToSomeSfsp[/color]\\foo.lsp") Example: foo.lsp is located in the user's Documents folder. Assuming that "C:\\Users\\" has been added to SFSP, then: Command: (load (strcat (getvar 'loginname) "\\Documents\\foo.lsp")) ** Bow ties are cool ** foo.lsp (prompt "\n** Bow ties are cool ** ") (princ) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted May 10, 2012 Share Posted May 10, 2012 ... Unless one adds the subfolder as a prefix to the string argument, which holds true for both the Load, and Findfile functions. Ah yes, I had overlooked that - thanks Renderman Quote Link to comment Share on other sites More sharing options...
BlackBox Posted May 10, 2012 Share Posted May 10, 2012 thanks Renderman You're welcome. Quote Link to comment Share on other sites More sharing options...
MSasu Posted May 11, 2012 Share Posted May 11, 2012 To recap the tests, please paste one by one the lines below on command line prompt and check what returns - starting from second one, all line except last (which may return nil), must return T if everything is well set: (vl-load-com) (vl-file-directory-p "C:\\Users\\Susan\\Documents\\Autodesk 2013\\My Projects\\WASTE WATER ELECTRICAL AND HVAC\\MCES CAD STANDARDS FOR 2012\\Lisp\\") (and (findfile "C:\\Users\\Susan\\Documents\\Autodesk 2013\\My Projects\\WASTE WATER ELECTRICAL AND HVAC\\MCES CAD STANDARDS FOR 2012\\Lisp\\LineTypes.lsp")) (and (findfile "Lisp\\LineTypes.lsp")) (vl-file-directory-p "C:\\Users\\Susan\\Documents\\Autodesk 2013\\My Projects\\WASTE WATER ELECTRICAL AND HVAC\\MCES CAD STANDARDS FOR 2012\\LINETYPES\\") (and (findfile "C:\\Users\\Susan\\Documents\\Autodesk 2013\\My Projects\\WASTE WATER ELECTRICAL AND HVAC\\MCES CAD STANDARDS FOR 2012\\LINETYPES\\MCES.lin")) (and (findfile "LINETYPES\\MCES.lin")) (wcmatch (vla-get-supportpath (vla-get-files (vla-get-preferences (vlax-get-acad-object)))) "*C:\\Users\\Susan\\Documents\\Autodesk 2013\\My Projects\\WASTE WATER ELECTRICAL AND HVAC\\MCES CAD STANDARDS FOR 2012*") (wcmatch (vla-get-supportpath (vla-get-files (vla-get-preferences (vlax-get-acad-object)))) "*C:\\Users\\Susan\\Documents\\Autodesk 2013\\My Projects\\WASTE WATER ELECTRICAL AND HVAC\\MCES CAD STANDARDS FOR 2012\\*") If last line will return T, then this should be investigated deeper. Quote Link to comment Share on other sites More sharing options...
nativedog Posted May 11, 2012 Author Share Posted May 11, 2012 Opening an AutoCAD 2013 format file. Regenerating model. AutoCAD menu utilities loaded. Metropolitan Council Environmental Services Configuration Loaded. AutoCAD MEP menu utilities loaded. AutoCAD Architecture menu utilities loaded. Command: Autodesk DWG. This file is a TrustedDWG last saved by an Autodesk application or Autodesk licensed application. Command: Command: (vl-load-com) Command: (vl-file-directory-p "C:\\Users\\Susan\\Documents\\Autodesk 2013\\My Projects\\WASTE WATER ELECTRICAL AND HVAC\\MCES CAD STANDARDS FOR 2012\\Lisp\\") T Command: (and (findfile "C:\\Users\\Susan\\Documents\\Autodesk 2013\\My Projects\\WASTE WATER ELECTRICAL AND HVAC\\MCES CAD STANDARDS FOR 2012\\Lisp\\LineTypes.lsp")) T Command: (and (findfile "Lisp\\LineTypes.lsp")) nil Command: (vl-file-directory-p "C:\\Users\\Susan\\Documents\\Autodesk 2013\\My Projects\\WASTE WATER ELECTRICAL AND HVAC\\MCES CAD STANDARDS FOR 2012\\LINETYPES\\") T Command: (and (findfile "C:\\Users\\Susan\\Documents\\Autodesk 2013\\My Projects\\WASTE WATER ELECTRICAL AND HVAC\\MCES CAD STANDARDS FOR 2012\\LINETYPES\\MCES.lin")) T Command: (and (findfile "LINETYPES\\MCES.lin")) nil Command: (wcmatch (vla-get-supportpath (vla-get-files (vla-get-preferences (vlax-get-acad-object)))) "*C:\\Users\\Susan\\Documents\\Autodesk 2013\\My Projects\\WASTE WATER ELECTRICAL AND HVAC\\MCES CAD STANDARDS FOR 2012*") nil Command: (wcmatch (vla-get-supportpath (vla-get-files (vla-get-preferences (vlax-get-acad-object)))) "*C:\\Users\\Susan\\Documents\\Autodesk 2013\\My Projects\\WASTE WATER ELECTRICAL AND HVAC\\MCES CAD STANDARDS FOR 2012\\*") nil Quote Link to comment Share on other sites More sharing options...
nativedog Posted May 11, 2012 Author Share Posted May 11, 2012 Does this make sense to you? So some strings came back with "T" but the last couple came back "nil" Quote Link to comment Share on other sites More sharing options...
BlackBox Posted May 11, 2012 Share Posted May 11, 2012 Please use . Quote Link to comment Share on other sites More sharing options...
MSasu Posted May 11, 2012 Share Posted May 11, 2012 Seems to me that the path: C:\\Users\\Susan\\Documents\\Autodesk 2013\\My Projects\\WASTE WATER ELECTRICAL AND HVAC\\MCES CAD STANDARDS FOR 2012 exists on your workstation, but you didn't added it to the list of Support File Search Path: Please check again. Click first the Add... button, this will add a new, empty entry; after use Browse... to indicate that path. Don't forget to confirm your changes. Quote Link to comment Share on other sites More sharing options...
nativedog Posted May 11, 2012 Author Share Posted May 11, 2012 I had it in with subfolders but not alone. Just added and it loaded. Thanks so much. Sorry to take up so much of your time for something that was probably very simple. Quote Link to comment Share on other sites More sharing options...
MSasu Posted May 11, 2012 Share Posted May 11, 2012 What is important is that your issue is now gone! You're entirely welcomed. Maybe is just the time to write down a small procedure describing the steps to install that tools pack on your workstation! Save it along the tools. May find it very useful later. Quote Link to comment Share on other sites More sharing options...
BlackBox Posted May 14, 2012 Share Posted May 14, 2012 This seemed relevant: (defun c:SFSP+ (/ *error*) (vl-load-com) (defun *error* (msg) (if oShell (setq oShell (vlax-release-object oShell))) (cond ((not msg)) ; Normal exit ((member msg '("Function cancelled" "quit / exit abort"))) ; <esc> or (quit) ((princ (strcat "\n** Error: " msg " ** ")))) ; Fatal error, display it (princ)) ((lambda (acApp / oShell oFolder acDoc acFiles path oldPath) (if (and (setq oShell (vlax-get-or-create-object "Shell.Application")) (setq oFolder (vlax-invoke oShell 'BrowseForFolder (vla-get-hwnd acApp) "Select a folder to add to SFSP:" 0))) (if (not (vl-string-search (strcase (setq path (strcat (vlax-get-property (vlax-get-property oFolder 'Self) 'Path) ";"))) (strcase (setq oldPath (strcat (vl-string-right-trim ";" (vla-get-supportpath (setq acFiles (vla-get-files (vla-get-preferences acApp))))) ";"))))) (progn (vla-put-supportpath acFiles (strcat oldPath ";" path)) (*error* nil)) (*error* "Path already exists in SFSP")) (cond (oShell (*error* nil)) ((*error* "Unable to create Shell.Application Object"))))) (vlax-get-acad-object))) Quote Link to comment Share on other sites More sharing options...
irneb Posted May 15, 2012 Share Posted May 15, 2012 You know you don't need VLA to do the support paths: (defun SFSP-append (path / sfsp) (setq sfsp (getenv "ACAD")) (if (not (wcmatch (strcase sfsp) (strcat "*" (strcase path) "*"))) (setenv "ACAD" (strcat sfsp ";" path)))) BTW, I can't remember exactly, but I thought there was some limit on the length of the total SFSP. So after adding several folders you might find that the last few folders are not stored in SFSP. Quote Link to comment Share on other sites More sharing options...
MSasu Posted May 15, 2012 Share Posted May 15, 2012 (getenv "ACAD") I knew for sure that I have used to parse the SFSP list in old versions of AutoCAD, prior to advent of VisualLISP, but I wasn't able to locate that old code. Thank you for refreshing my memory! BTW, I can't remember exactly, but I thought there was some limit on the length of the total SFSP. So after adding several folders you might find that the last few folders are not stored in SFSP. This is an interesting observation that should be accounted! Quote Link to comment Share on other sites More sharing options...
irneb Posted May 15, 2012 Share Posted May 15, 2012 Glad to remind you ... also remember that environment variables are case sensitive, so (getenv "acad") will give nil. As for the limit on length - I don't know if it still applies. I think it was an old Registry limit of around 4000 characters. Perhaps with newer Windows the limit has disappeared, though I'm not going to test it Edit: Apparently it's 800 characters, and it's still listed as an Issue ... up to 2007, don't know of later ACads! http://usa.autodesk.com/adsk/servlet/ps/dl/item?siteID=123112&id=2884947&linkID=9240617 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.