Author Topic: How to backup Alias commands  (Read 3189 times)

0 Members and 1 Guest are viewing this topic.

MUQTAR

  • Guest
How to backup Alias commands
« on: October 28, 2011, 03:05:26 PM »
hi everyone,

i m normally using alias edit to customize my commands.
when i reinstalling my auto-cad i have to customize them again there is any way that i can take backup and replace them again

Ketxu

  • Newt
  • Posts: 109
Re: How to backup Alias commands
« Reply #1 on: October 28, 2011, 10:22:36 PM »
Alias edit just changed your acad.pgp. Backup this file :)

MUQTAR

  • Guest
Re: How to backup Alias commands
« Reply #2 on: December 21, 2011, 08:46:51 AM »
acad.pgp does not exist all alias commands

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: How to backup Alias commands
« Reply #3 on: December 21, 2011, 09:50:08 AM »
It's ugly, but I've been successfully using it for a while...

Code: [Select]
(defun c:EDITPGP (/ pgp-file fn pgp_commands)
  ;;edit acad.pgp file, will add predefined macros to pgp
  ;;created by: alan thompson - 4.1.08
  ;;updated by: alan thompson - 7.14.08 (cleaned up code a little - writes as single line vs. each individually)

  (if (and (setq pgp-file (findfile "acad.pgp"))
           (setq fn (open pgp-file "a"))
      )
    (progn
      (setq pgp_commands
             "
; * * * * * * * * * * * * * * * *
; * * * alan's PGP commands * * *
; * * * * * * * * * * * * * * * *
`,         *QLEADER
1,         *LayerCurrent
2,         *LayerSet
3,         *LayerOff
4,         *LayerFreeze
5,         *MLEADER
6,         *LayerMatchSet
7,         *LIST
8,         *LayerP
9,         *EXTRIM
0,         *MATH
66,        *LFP
MM,        *MATCHPROP
BP,        *BPOLY
OF,        *LAYOFF
FE,        *LAYFRZ
BC,        *BSCALE
CV,        *COPY
CH,        *CHPROP
D,         *DIST
IN,        *-INSERT
LA,        *-LAYER
LAY,       *CLASSICLAYER
R,         *ROTATE
GL,        *GLUE
REF,       *REFEDIT
QS,        *QSAVE
RE,        *REGENALL
LG,        *LENGTHEN
JT,        *JUSTIFYTEXT
DS,        *DIMSTYLE
SW,        *AECLINEWORKSHRINKWRAP
ww,        *wipeout
P,         *PLINE
CN,        *NCOPY
OK,        *OVERKILL
QA,        *QLATTACH
DC,        *DIMCONTINUE
AA,        *ALAN
T2,        *TXT2MTXT
FA,        *FLATTEN
XR,        *CLASSICXREF
IM,        *CLASSICIMAGE
V,         *VPLAYER
Q,         *QSELECT
OP,        *OOPS
TTF,       *TEXTTOFRONT
QD,        *QDIM
B,         *BREAK
DS,        *DIMDISASSOCIATE
AE,        *ATTIPEDIT
GET,       *GETSEL

;APPLICATIONS
IE,        START IEXPLORE,   1,,
WORD,      START WINWORD,    1,,

;C3D COMMANDS
3J,        *AeccJoinFeatures
AM,        *AIMLEADEREDITADD
CG,        *CGLIST
CA,        *CGANG
NG,        *LABELDLGGENERALNOTE
RL,        *LABELREVERSEBEARING
FP,        *LABELFLIP
RB,        *LABELREVERSEBEARING
CEO,       *CURVEFROMENDOFOBJECT
RCC,       *REVERSEORCOMPOUND
OI,        *ISOLATEOBJECTS
OH,        *HIDEOBJECTS
LSE,       *LABELSTYLEEDIT
"     )

      (write-line pgp_commands fn)

      (close fn)
      (setvar 're-init 16)
    )
  )
  (alert (strcat "\nHey "
                 (getvar "loginname")
                 " your acad.pgp has been updated with the following: "
                 pgp_commands
         )
  )
  (princ)
)
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: How to backup Alias commands
« Reply #4 on: December 21, 2011, 10:27:27 AM »
The "problem" with simply copying the PGP file to another machine / ACad install / upgrade is that you might loose any shortcuts for new commands.

However it's not all gloom. You can simply open the ACAD.PGP file (usually found in your User directory - C:\Users\<<UserName>>\AppData\Roaming\Autodesk\AutoCAD 2012 - English\R18.2\enu\Support) in something like NotePad. Scroll down to its end. After the comment block starting with:
Quote
;  -- User Defined Command Aliases --
;  Make any changes or additions to the default AutoCAD command aliases in
...
You would see all the edits made through Alias Editor. All the edits you've added / redefined that is. Not the removed aliases (which would be comments on the standard aliases in the first section(s) of the file). Thus you can copy these into the end of any new ACad install.
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: How to backup Alias commands
« Reply #5 on: December 21, 2011, 10:29:57 AM »
The "problem" with simply copying the PGP file to another machine / ACad install / upgrade is that you might loose any shortcuts for new commands.

However it's not all gloom. You can simply open the ACAD.PGP file (usually found in your User directory - C:\Users\<<UserName>>\AppData\Roaming\Autodesk\AutoCAD 2012 - English\R18.2\enu\Support) in something like NotePad. Scroll down to its end. After the comment block starting with:
Quote
;  -- User Defined Command Aliases --
;  Make any changes or additions to the default AutoCAD command aliases in
...
You would see all the edits made through Alias Editor. All the edits you've added / redefined that is. Not the removed aliases (which would be comments on the standard aliases in the first section(s) of the file). Thus you can copy these into the end of any new ACad install.
Precisely what my above routine does. :)
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: How to backup Alias commands
« Reply #6 on: December 21, 2011, 10:51:07 AM »
Precisely what my above routine does. :)
Sorry, I didn't mean to step on toes  :angel: Your routine should do perfectly after modifying it to suit the OP's own shortcuts.  :kewl:

What I'm suggesting is that it's usually a thing you do once (per year at most), so is it all that necessary to write a LSP for this simply to have a one-click instead of opening 2 files, select-copy-n-paste? I suppose one could even write some sort of "merge" routine which would add aliases from one PGP into another if they're not already found there.Might make it even esier: no need to edit the LSP after you've modified your PGP through Alias Edit (or whatever you use).
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: How to backup Alias commands
« Reply #7 on: December 21, 2011, 10:58:36 AM »
Precisely what my above routine does. :)
Sorry, I didn't mean to step on toes  :angel: Your routine should do perfectly after modifying it to suit the OP's own shortcuts.  :kewl:

What I'm suggesting is that it's usually a thing you do once (per year at most), so is it all that necessary to write a LSP for this simply to have a one-click instead of opening 2 files, select-copy-n-paste? I suppose one could even write some sort of "merge" routine which would add aliases from one PGP into another if they're not already found there.Might make it even esier: no need to edit the LSP after you've modified your PGP through Alias Edit (or whatever you use).
Toes not stepped on at all. :)

Yeah, I thought about that when I wrote it, but I had to store my shortcuts in a textfile and I figured why not just add a few parenthesis and change the extension from .txt to .lsp
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox