I would love to either have a lisp command that would do all of the above steps and have to run it when needed .....
(defun c:update-profile ( profile location / danames acd pro pre )
;; this will update a users profile
;;
;; Usage:
;; (update-profile "[ name ] " " [ path to ] ")
;; ...like:
;; (update-profile "Dumb" "c:\\StupidProfiles\\")
;;
(vl-load-com)
(setq acd (vlax-get-acad-object)
pre (vla-get-preferences acd)
pro (vla-get-profiles pre))
(cond
((eq (getvar "CPROFILE") profile)
(vla-getallprofilenames
pro
'danames)
(setq danames (vlax-safearray->list danames))
(vlax-put-property
pro
'ActiveProfile
(if (eq (car danames) profile) (cadr danames) (car danames)))
(update-profile "mike15" c:\\ACADtemp\\profile\\) )
(t
(vla-deleteprofile
pro
profile)
;; delete the prorile
(vla-importprofile
pro
profile
(strcat location profile ".arg")
:vlax-true)
(vlax-put-property
pro
'ActiveProfile
profile))
)
)
;;;MWA Custom Programs************************************
;THESE LISP FILES CAN BE FOUND in S:\ACAD Support\LSP
;[Message]^C^C(if (not C:message) (load "message"));message LOADS THIS PROGRAM AUTOMATICALLY if no semicolin
(autoload "webb-trees" '("webb-trees"));replaces webb tree blocks with MWA's
(autoload "ucszoom" '("uZ"));adjusts ucs per selection
(autoload "ddshapes" '("ddshapes")); steel shapes library
(autoload "dofix" '("dofix"));draw order fix routine
(autoload "archdo" '("archdo"));draw order fix routine for arch base
(autoload "ssfix" '("ssfix"));MWA sheet set, page layout replace
(autoload "hd" '("hd"));true horizontal distance
(autoload "LL" '("ll"));draws lines at bearing and distance
(autoload "AUTOFLAT" '("AUTOFLAT"))
(autoload "mwapsetups" '("mwapsetups"))
(autoload "2ML" '("2ML"))
(autoload "exp" '("exp"));Starts windows explorer in current directory
(autoload "VPXLF" '("VPXLF"));Freeze layer in current viewport
(autoload "XLF" '("XLF"));Freeze XREF Layer
(autoload "XLO" '("XLO"));Turn off XREF Layer
(autoload "Xil" '("Xil"));Isolate XREF Layer
(autoload "LAYS" '("LF"));WILL FREEZE SELECTED LAYER
(autoload "LAYS" '("LO"));TURNS LAYER OFF
(autoload "LAYS" '("LS"));SETS PICKED ITEM'S LAYER CURRENT
(autoload "sla" '("sla"));slope arrow
;------------------COMMANDS FOR ELV2 LSP----------------
(autoload "elv2" '("NT"))
(autoload "elv2" '("ST"))
(autoload "elv2" '("ET"))
(autoload "elv2" '("WT"))
(autoload "elv2" '("NW"))
(autoload "elv2" '("NE"))
(autoload "elv2" '("SE"))
(autoload "elv2" '("SW"))
(autoload "elv2" '("NW2"))
(autoload "elv2" '("NE2"))
(autoload "elv2" '("SE2"))
(autoload "elv2" '("SW2"))
(autoload "elv2" '("NW3"))
(autoload "elv2" '("NE3"))
(autoload "elv2" '("SE3"))
(autoload "elv2" '("NE44"))
(autoload "elv2" '("SE44"))
(autoload "elv2" '("NW44"))
(autoload "elv2" '("SW44"))
(autoload "elv2" '("NW45"))
(autoload "elv2" '("NE45"))
(autoload "elv2" '("SE45"))
(autoload "elv2" '("SW45"))
(autoload "elv2" '("NE62"))
(autoload "elv2" '("SE62"))
(autoload "elv2" '("NW62"))
(autoload "elv2" '("SW62"))
(autoload "elv2" '("NE64"))
(autoload "elv2" '("SE64"))
(autoload "elv2" '("NW64"))
(autoload "elv2" '("SW64"))
(autoload "elv2" '("NE84"))
(autoload "elv2" '("SE84"))
(autoload "elv2" '("NW84"))
(autoload "elv2" '("SW84"))
(autoload "elv2" '("PL1"))
(autoload "elv2" '("PL2"))
(autoload "elv2" '("PL3"))
(autoload "elv2" '("PL4"))
(autoload "elv2" '("PL5"))
(autoload "elv2" '("PL6"))
(autoload "elv2" '("GAR"))
(autoload "elv2" '("SITE"))
(autoload "elv2" '("SCA"))
(autoload "elv2" '("SCB"))
(autoload "elv2" '("SCC"))
(autoload "elv2" '("SCD"))
(autoload "elv2" '("SCE"))
(autoload "elv2" '("SCF"))
(autoload "elv2" '("SCG"))
(autoload "elv2" '("SCH"))
(autoload "elv2" '("SCJ"))
(autoload "elv2" '("SCK"))
(autoload "elv2" '("HID1"))
(autoload "elv2" '("HID2"))
(autoload "elv2" '("HID3"))
(autoload "elv2" '("HID4"))
;-------------------END ELV2 LSP --------------------
;------------------LEVELS2 LSP --------------------
(autoload "levels2" '("A1"))
(autoload "levels2" '("A2"))
(autoload "levels2" '("A3"))
(autoload "levels2" '("ELC1"))
(autoload "levels2" '("ELC2"))
(autoload "levels2" '("ELC3"))
(autoload "levels2" '("SITEL"))
(autoload "levels2" '("RFOFF"))
(autoload "levels2" '("RP"))
(autoload "levels2" '("RPCLR"))
(autoload "levels2" '("STCP"))
(autoload "levels2" '("TON"))
(autoload "levels2" '("TPS"))
(autoload "levels2" '("ELON"))
(autoload "levels2" '("ELOFF"))
(autoload "levels2" '("ON"))
(autoload "levels2" '("OA"))
(autoload "levels2" '("FA"))
(autoload "levels2" '("TA"))
(autoload "levels2" '("OFF"))
;----------------------END----------------
(autoload "win" '("win"))
(autoload "win" '("wintrim"))
(autoload "win" '("DOOR"))
(autoload "win" '("DOORTRIM"))
(autoload "DVTW" '("DTW"))
(autoload "DVTW" '("DTW0"))
(autoload "DVTW" '("DTWR"))
(autoload "DVTW" '("TWT"))
(autoload "flatten" '("flatten"))
(autoload "half" '("half"))
(defun C:Lsp ()
(setvar "CMDECHO" 0)
(setq TXTa (getstring "\nENTER NAME OF LISP ROUTINE TO LOAD: "))
(LOAD TXTa)
(setq TXTp (strcat "\n" TXTa " HAS BEEN LOADED...... "))
(setvar "CMDECHO" 1)
(prompt TXTp)
(princ)
)
;"ld" lenthen dynamic
(defun c:lgd () (command "lengthen" "dy") (princ))
;"le" lenthen delta
(defun c:lge () (command "lengthen" "de") (princ))
;"lt" lenthen total
(defun c:lgt () (command "lengthen" "t") (princ))
(princ)
(LOAD "DOFIX")
(if (tblsearch "block" "rundofix")
(c:dofix)
(princ)
)
(setvar "hpmaxlines" 10000000)
(defun MWAStartup ()
(command "._purge" "r" "*" "_n") ;;purge regapps
(command "HPMAXAREAS" 0)
(command "-scalelistedit" "_r" "_y" "_e");;reset scale list
(graphscr)
)
(if S::STARTUP
(setq S::STARTUP (append S::STARTUP '((MWAStartup)) ))
(defun s::startup ( ) (MWAStartup) )
)
Quote from: strebor71
I would love to either have a lisp command that would do all of the above steps and have to run it when needed .....
That is exactly how I've been handling it for over a decade now. We don't fool with "profiles" at all. Everything is simply "set" as needed at startup. Anything not "set" by the company startup files, the user is free to change (personal pref items). Many users elect to have me roll their personal preferences into their own personal startup lisp (which this system supports) and then if they get a new machine or have to go use a spare machine, virtually everything is set after they log on and startup AutoCAD.
I doubt the file is to large its only 5K. Having a common accaddoc.lsp saves a whole lot of time on configuring a new system. simply install, copy over custom pgp, launch once, exit autocad, modify shortcut to include custom profile with path to accaddoc and and you just about done. I will have to experiment with a enterprise cui, I hadnt thought about using one.
a question for seven on his profile loader, I cant seem to get your function to be its own runnable command. I added a c: to the defun but it errors with a too few arguments message.Code: [Select](defun c:update-profile ( profile location / danames acd pro pre )
;; this will update a users profile
;;
;; Usage:
;; (update-profile "[ name ] " " [ path to ] ")
;; ...like:
;; (update-profile "Dumb" "c:\\StupidProfiles\\")
;;
(vl-load-com)
(setq acd (vlax-get-acad-object)
pre (vla-get-preferences acd)
pro (vla-get-profiles pre))
(cond
((eq (getvar "CPROFILE") profile)
(vla-getallprofilenames
pro
'danames)
(setq danames (vlax-safearray->list danames))
(vlax-put-property
pro
'ActiveProfile
(if (eq (car danames) profile) (cadr danames) (car danames)))
(update-profile "mike15" c:\\ACADtemp\\profile\\) )
(t
(vla-deleteprofile
pro
profile)
;; delete the prorile
(vla-importprofile
pro
profile
(strcat location profile ".arg")
:vlax-true)
(vlax-put-property
pro
'ActiveProfile
profile))
)
)
accaddoc.lsp fileCode: [Select];;;MWA Custom Programs************************************
;THESE LISP FILES CAN BE FOUND in S:\ACAD Support\LSP
;[Message]^C^C(if (not C:message) (load "message"));message LOADS THIS PROGRAM AUTOMATICALLY if no semicolin
(autoload "webb-trees" '("webb-trees"));replaces webb tree blocks with MWA's
(autoload "ucszoom" '("uZ"));adjusts ucs per selection
(autoload "ddshapes" '("ddshapes")); steel shapes library
(autoload "dofix" '("dofix"));draw order fix routine
(autoload "archdo" '("archdo"));draw order fix routine for arch base
(autoload "ssfix" '("ssfix"));MWA sheet set, page layout replace
(autoload "hd" '("hd"));true horizontal distance
(autoload "LL" '("ll"));draws lines at bearing and distance
(autoload "AUTOFLAT" '("AUTOFLAT"))
(autoload "mwapsetups" '("mwapsetups"))
(autoload "2ML" '("2ML"))
(autoload "exp" '("exp"));Starts windows explorer in current directory
(autoload "VPXLF" '("VPXLF"));Freeze layer in current viewport
(autoload "XLF" '("XLF"));Freeze XREF Layer
(autoload "XLO" '("XLO"));Turn off XREF Layer
(autoload "Xil" '("Xil"));Isolate XREF Layer
(autoload "LAYS" '("LF"));WILL FREEZE SELECTED LAYER
(autoload "LAYS" '("LO"));TURNS LAYER OFF
(autoload "LAYS" '("LS"));SETS PICKED ITEM'S LAYER CURRENT
(autoload "sla" '("sla"));slope arrow
;------------------COMMANDS FOR ELV2 LSP----------------
(autoload "elv2" '("NT"))
(autoload "elv2" '("ST"))
(autoload "elv2" '("ET"))
(autoload "elv2" '("WT"))
(autoload "elv2" '("NW"))
(autoload "elv2" '("NE"))
(autoload "elv2" '("SE"))
(autoload "elv2" '("SW"))
(autoload "elv2" '("NW2"))
(autoload "elv2" '("NE2"))
(autoload "elv2" '("SE2"))
(autoload "elv2" '("SW2"))
(autoload "elv2" '("NW3"))
(autoload "elv2" '("NE3"))
(autoload "elv2" '("SE3"))
(autoload "elv2" '("NE44"))
(autoload "elv2" '("SE44"))
(autoload "elv2" '("NW44"))
(autoload "elv2" '("SW44"))
(autoload "elv2" '("NW45"))
(autoload "elv2" '("NE45"))
(autoload "elv2" '("SE45"))
(autoload "elv2" '("SW45"))
(autoload "elv2" '("NE62"))
(autoload "elv2" '("SE62"))
(autoload "elv2" '("NW62"))
(autoload "elv2" '("SW62"))
(autoload "elv2" '("NE64"))
(autoload "elv2" '("SE64"))
(autoload "elv2" '("NW64"))
(autoload "elv2" '("SW64"))
(autoload "elv2" '("NE84"))
(autoload "elv2" '("SE84"))
(autoload "elv2" '("NW84"))
(autoload "elv2" '("SW84"))
(autoload "elv2" '("PL1"))
(autoload "elv2" '("PL2"))
(autoload "elv2" '("PL3"))
(autoload "elv2" '("PL4"))
(autoload "elv2" '("PL5"))
(autoload "elv2" '("PL6"))
(autoload "elv2" '("GAR"))
(autoload "elv2" '("SITE"))
(autoload "elv2" '("SCA"))
(autoload "elv2" '("SCB"))
(autoload "elv2" '("SCC"))
(autoload "elv2" '("SCD"))
(autoload "elv2" '("SCE"))
(autoload "elv2" '("SCF"))
(autoload "elv2" '("SCG"))
(autoload "elv2" '("SCH"))
(autoload "elv2" '("SCJ"))
(autoload "elv2" '("SCK"))
(autoload "elv2" '("HID1"))
(autoload "elv2" '("HID2"))
(autoload "elv2" '("HID3"))
(autoload "elv2" '("HID4"))
;-------------------END ELV2 LSP --------------------
;------------------LEVELS2 LSP --------------------
(autoload "levels2" '("A1"))
(autoload "levels2" '("A2"))
(autoload "levels2" '("A3"))
(autoload "levels2" '("ELC1"))
(autoload "levels2" '("ELC2"))
(autoload "levels2" '("ELC3"))
(autoload "levels2" '("SITEL"))
(autoload "levels2" '("RFOFF"))
(autoload "levels2" '("RP"))
(autoload "levels2" '("RPCLR"))
(autoload "levels2" '("STCP"))
(autoload "levels2" '("TON"))
(autoload "levels2" '("TPS"))
(autoload "levels2" '("ELON"))
(autoload "levels2" '("ELOFF"))
(autoload "levels2" '("ON"))
(autoload "levels2" '("OA"))
(autoload "levels2" '("FA"))
(autoload "levels2" '("TA"))
(autoload "levels2" '("OFF"))
;----------------------END----------------
(autoload "win" '("win"))
(autoload "win" '("wintrim"))
(autoload "win" '("DOOR"))
(autoload "win" '("DOORTRIM"))
(autoload "DVTW" '("DTW"))
(autoload "DVTW" '("DTW0"))
(autoload "DVTW" '("DTWR"))
(autoload "DVTW" '("TWT"))
(autoload "flatten" '("flatten"))
(autoload "half" '("half"))
(defun C:Lsp ()
(setvar "CMDECHO" 0)
(setq TXTa (getstring "\nENTER NAME OF LISP ROUTINE TO LOAD: "))
(LOAD TXTa)
(setq TXTp (strcat "\n" TXTa " HAS BEEN LOADED...... "))
(setvar "CMDECHO" 1)
(prompt TXTp)
(princ)
)
;"ld" lenthen dynamic
(defun c:lgd () (command "lengthen" "dy") (princ))
;"le" lenthen delta
(defun c:lge () (command "lengthen" "de") (princ))
;"lt" lenthen total
(defun c:lgt () (command "lengthen" "t") (princ))
(princ)
(LOAD "DOFIX")
(if (tblsearch "block" "rundofix")
(c:dofix)
(princ)
)
(setvar "hpmaxlines" 10000000)
(defun MWAStartup ()
(command "._purge" "r" "*" "_n") ;;purge regapps
(command "HPMAXAREAS" 0)
(command "-scalelistedit" "_r" "_y" "_e");;reset scale list
(graphscr)
)
(if S::STARTUP
(setq S::STARTUP (append S::STARTUP '((MWAStartup)) ))
(defun s::startup ( ) (MWAStartup) )
)
Quote from: strebor71
I would love to either have a lisp command that would do all of the above steps and have to run it when needed .....
That is exactly how I've been handling it for over a decade now. We don't fool with "profiles" at all. Everything is simply "set" as needed at startup. Anything not "set" by the company startup files, the user is free to change (personal pref items). Many users elect to have me roll their personal preferences into their own personal startup lisp (which this system supports) and then if they get a new machine or have to go use a spare machine, virtually everything is set after they log on and startup AutoCAD.
So what are the company startup files you speak of? dont you need a profile to set the proper paths to load the company statrup files?