Author Topic: Load PGP file  (Read 5693 times)

0 Members and 1 Guest are viewing this topic.

cadman6735

  • Guest
Load PGP file
« on: September 15, 2011, 11:39:51 AM »
How would I load a custom PGP file without putting it into my Options, support file list?

All I want to do is key command "loadPGP" and it looks for and load my custom pgp from a specified path without editing the profile, options or workspace.  When the applicaiton closes and reopens, I want to key in the command again to gain access to my PGP file once again.

Thanks

Edit, I keep my pgp file on an external clip that I can plug in, so I can keep one PGP file and when moving from desktop to laptop I just plug in the clip.
« Last Edit: September 15, 2011, 11:42:55 AM by cadman6735 »

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Load PGP file
« Reply #1 on: September 15, 2011, 11:43:42 AM »
Copy the 'custom' acad.pgp file to the active drawing's directory, (setvar 're-init 16), then delete the file.
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

Krushert

  • Seagull
  • Posts: 13679
  • FREE BEER Tomorrow!!
Re: Load PGP file
« Reply #2 on: September 15, 2011, 11:54:28 AM »
Copy the 'custom' acad.pgp file to the active drawing's directory, (setvar 're-init 16), then delete the file.
I can not seem to find that Variable. How do you access it?  I have the setvar route at the command line.

Nevermind found it.
I + XI = X is true ...  ... if you change your perspective.

I no longer CAD or Model, I just hang out here picking up the empties beer cans

cadman6735

  • Guest
Re: Load PGP file
« Reply #3 on: September 15, 2011, 11:59:04 AM »
Hi Alan

yes, I don't want to copy the file anywhere, I am just curiouse if it is possible to load a pgp file manualy from a specified location.

Thanks

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Load PGP file
« Reply #4 on: September 15, 2011, 01:20:26 PM »
Hi Alan

yes, I don't want to copy the file anywhere, I am just curiouse if it is possible to load a pgp file manualy from a specified location.

Thanks
You could add the path to the support paths in options. Can easily be done with code.

Code: [Select]
(defun _addSupportPath (path / support files)
  (if (not (wcmatch
             (strcase (setq support (vla-get-supportpath
                                      (setq files (vla-get-files
                                                    (vla-get-preferences
                                                      (vlax-get-acad-object)
                                                    )
                                                  )
                                      )
                                    )
                      )
             )
             (strcat "*" (strcase path) "*")
           )
      )
    (vla-put-supportpath files (strcat path ";" support))
  )
)
« Last Edit: September 16, 2011, 06:18:44 AM by alanjt »
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

Ketxu

  • Newt
  • Posts: 109
Re: Load PGP file
« Reply #5 on: September 16, 2011, 12:19:00 AM »
Hi cadman6735, Why don't you use mini lisp rountine to set shortcut key ? i don't like use PGP ^^

huiz

  • Swamp Rat
  • Posts: 919
  • Certified Prof C3D
Re: Load PGP file
« Reply #6 on: September 16, 2011, 02:57:34 AM »
As far as I know a file "acad.pgp" is loaded automatically if it is found in the Support File Path. It also depends on the sequence of the paths. I thought the most upper path is used where an acad.pgp is found. Or maybe they are loaded over each other, don't know exactly.

With ReInit you can reload a pgp file.

So maybe it is possible to use VLisp to add a new path to the Support File Path where a pgp file is found and then with ReInit you load your version, all done with a lisp file. That's a way to automate things.
The conclusion is justified that the initialization of the development of critical subsystem optimizes the probability of success to the development of the technical behavior over a given period.

Chris

  • Swamp Rat
  • Posts: 548
Re: Load PGP file
« Reply #7 on: September 16, 2011, 09:25:02 AM »
Here's what I did for mine:
have a text file with your custom commands, then:

Code: [Select]
(defun c:ccd (/ path1)
      (vl-load-com)
      (setq path1 (strcat (vl-filename-directory (findfile "acad.pgp")) "\\")
               proglocationc "MYPATH")
      (if (= (vl-file-systime (strcat path1 logan "acad.pgp")) nil)
(progn
  (vl-file-copy
    (strcat path1 "acad.pgp")
    (strcat path1 logan "acad.pgp")
  ) ;_ end of vl-file-copy
  (vl-file-copy
    (strcat proglocationc "cowgill.txt")
    (strcat path1 "acad.pgp")
    t
  ) ;_ end of vl-file-copy
  (setvar "re-init" 16)
) ;_ end of progn
(progn
  (vl-file-delete (strcat path1 "acad.pgp"))
  (vl-file-rename
    (strcat path1 logan "acad.pgp")
    (strcat path1 "acad.pgp")
  ) ;_ end of vl-file-rename
  (setvar "re-init" 16)
) ;_ end of progn
      ) ;_ end of if
    ) ;_ end of defun

obviously you'd rename a few of the file names, but basically what it does is make a copy of the existing pgp, using the user's login name, then copy's the custom pgp commands from the cowgill.txt file into the acad.pgp, then reninits.  If you run the command again, it erases acad.pgp, and renames the original file back to acad.pgp.
Christopher T. Cowgill, P.E.
AEC Collection 2020 (C3D)
Win 10