Author Topic: Startup Priority  (Read 11585 times)

0 Members and 1 Guest are viewing this topic.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Startup Priority
« Reply #30 on: August 01, 2006, 03:03:00 PM »
Tim

Thanks for sharing this one, I see now that I have some cleanup to do.

Gary

No problem.  It looked like it would be fun to see how to solve the problem.  It worked on my computer.

I don't have all the autoload lines in the mnl...I have a line that looks for an external file with all the lisp definitions in it and loads it if found. I know I need to do some cleanup but what i don't understand here is why reinit doesn't recognize my command aliases when manually initialized after startup.

If you have code to this affect:
Code: [Select]
(AUTOLOAD "bb" '("bb"))
when you enter bb it will autoload the function regardless of the pgp setting, won't it?.
I have "AA" defined as a multi-select block edit program.  After I run the program I posted, it issues the area command, so it looks like it will work.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

CADaver

  • Guest
Re: Startup Priority
« Reply #31 on: August 01, 2006, 03:15:03 PM »
I don't have all the autoload lines in the mnl...I have a line that looks for an external file with all the lisp definitions in it and loads it if found. I know I need to do some cleanup but what i don't understand here is why reinit doesn't recognize my command aliases when manually initialized after startup.

If you have code to this affect:
Code: [Select]
(AUTOLOAD "bb" '("bb"))
when you enter bb it will autoload the function regardless of the pgp setting, won't it?.
I have "AA" defined as a multi-select block edit program.  After I run the program I posted, it issues the area command, so it looks like it will work.
I can sorta see where it would.  You've basically redefined the function from the PGP. 

But I think my evaluation of the AUTOLOAD vs PGP is the reason his original attempt was not working, right?

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Startup Priority
« Reply #32 on: August 01, 2006, 03:20:46 PM »
I don't have all the autoload lines in the mnl...I have a line that looks for an external file with all the lisp definitions in it and loads it if found. I know I need to do some cleanup but what i don't understand here is why reinit doesn't recognize my command aliases when manually initialized after startup.

If you have code to this affect:
Code: [Select]
(AUTOLOAD "bb" '("bb"))
when you enter bb it will autoload the function regardless of the pgp setting, won't it?.
I have "AA" defined as a multi-select block edit program.  After I run the program I posted, it issues the area command, so it looks like it will work.
I can sorta see where it would.  You've basically redefined the function from the PGP. 

But I think my evaluation of the AUTOLOAD vs PGP is the reason his original attempt was not working, right?
I think so, based on what Jeff quoted from the help files.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

ronjonp

  • Needs a day job
  • Posts: 7529
Re: Startup Priority
« Reply #33 on: August 01, 2006, 03:31:25 PM »
Tim,

Thats a sweet little routine. Worked like a charm here :).

Thanks for your efforts,

Ron

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Startup Priority
« Reply #34 on: August 01, 2006, 03:35:23 PM »
Tim,

Thats a sweet little routine. Worked like a charm here :).

Thanks for your efforts,

Ron
You're welcome Ron.  It was fun to test the brain.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

CADaver

  • Guest
Re: Startup Priority
« Reply #35 on: August 01, 2006, 05:57:17 PM »
Thanks for your efforts,
Yeah, thanks Tim.  While I'll probably never use the routine, there are some nifty tricks there for future projects.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Startup Priority
« Reply #36 on: August 01, 2006, 06:04:29 PM »
Thanks for your efforts,
Yeah, thanks Tim.  While I'll probably never use the routine, there are some nifty tricks there for future projects.
One thing you can do, is comment out the line where it makes the defun, and just find out what command alias's you are overwritting.  Could be cool just to see.

You're welcome to all.  Have fun using it or learning something from it.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Startup Priority
« Reply #37 on: August 02, 2006, 03:26:48 PM »
Found an even better way to do this on the Adesk site.  The only problem is, it will always list all the values that match an alias.  But it will make the command calls look better.  But as Tony T. pointed out, it would have to ran per drawing opened.
Code: [Select]
(defun c:ResetPgp (/ pgpFile Opened TextLine ComamndList LispRoutine)

(if (setq pgpFile (findfile "acad.pgp"))
 (progn
  (setq Opened (open pgpFile "r"))
  (while (setq TextLine (read-line Opened))
   (if
    (and
     (/= (substr TextLine 1 1) ";")
     (vl-string-search "," TextLine)
     (vl-string-search "*" TextLine)
    )
    (setq CommandList
     (cons
      (cons
       (strcase (substr TextLine 1 (vl-string-search "," TextLine)))
       (strcat "." (substr TextLine (+ 2 (vl-string-search "*" TextLine))))
      )
      CommandList
     )
    )
   )
  )
  (close Opened)
  (foreach LispRoutine (vl-remove-if-not '(lambda (x) (= (strcase (substr x 1 2)) "C:")) (atoms-family 1))
   (if (setq tmpList (assoc (strcase (substr LispRoutine 3)) CommandList))
    (progn
     (vl-acad-undefun (eval LispRoutine)) ;; The one new thing added
     (prompt (strcat "\n Lisp routine \"" (substr LispRoutine 3) "\" is repalced with acad.pgp command alias."))
    )
   )
  )
 )
)
(princ)
)
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Startup Priority
« Reply #38 on: August 02, 2006, 03:39:05 PM »
$.02

............  my advice would be to defun it as "LabelMakerThingymabobber" and let people shortcut it as they will.  If it's on a menu, it makes no difference at all if it has a short name or not, for people who want to run it commandline, they can do so.

ditto ^^ .. this  has worked well for be. I use a shortcuts.LSP file for the alias definitions, which loads last on the startup sequence     


   
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.