Guest looseLISPSsinkSHIPS Posted November 30, 2009 Posted November 30, 2009 Hi, I'm not at all familiar with the VLAX method in AutoLISP codes yet however I need the following code to run unnoticed at the start-up of AutoCAD (assuming the acad2009doc.lsp would be the best home for it) NOTE: at current I can only copy and past the code into the commands prompt to work. Can anybody help me with this? (vl-load-com) (setq acadobject (vlax-get-Acad-Object)) (setq acadprefs (vla-get-preferences acadobject)) (setq acadprofiles (vla-get-profiles acadprefs)) (vla-put-ActiveProfile acadProfiles "P20090626A") Quote
BlackAlnet Posted November 30, 2009 Posted November 30, 2009 Just save this as a ".lsp" file and add to "Startup Suite", at Load/Unload Applications menu(ap command) Quote
gile Posted November 30, 2009 Posted November 30, 2009 Hi, First, acad2009doc.lsp is not the best home for customized startup routines. acad2009doc.lsp is an AutoCAD reserved file which can be edited on AutoCAD updates. You'd rather make your own acaddoc.lsp file in a search path or use a a same named MNL file as the CUI file you're using. If you want to avoid any notification at the command prompt you can make an anonymous function (lambda) which ends with a (princ) call. If you don't need acadobject, acadprefs, and acadprofilesas as global variables, you can nest the expressions in a single one. The way I'll do it: create an acaddoc.lsp file in a search path and add to it: (vl-load-com) ((lambda () (vla-put-ActiveProfile (vla-get-Profiles (vla-get-Preferences (vlax-get-acad-object))) "P20090626A" ) (princ) ) ) Quote
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.