Author Topic: Startup suite alternatives  (Read 6102 times)

0 Members and 1 Guest are viewing this topic.

ELOQUINTET

  • Guest
Startup suite alternatives
« on: May 16, 2006, 12:28:51 PM »
hey guys i may have posted questions about this before but am still not happy with the way things are going. i have started putting my lisp files in acaddoc.lsp and that works fine. It is other formats i am having some problems with, specifically .vlx and .dvb files. some of my .vlx files are working with this:

(autoload "Modattrel.vlx" '("MODATT"))

and others are not
and .dvb i have not been able to get it to work either.
i have heard some mention creating an .mnl but i don't know how to do that

i need some help because i am getting sick of dealing with the startup suite


ronjonp

  • Needs a day job
  • Posts: 7531
Re: Startup suite alternatives
« Reply #1 on: May 16, 2006, 12:48:55 PM »
I use this to load dvb's

Code: [Select]
    (if (findfile "C:/yourvbaroutine.dvb")
      (progn
(princ "\n   <<VBA Stuff Loaded>>")
(princ)
(vl-vbaload
  (findfile "C:/yourvbaroutine.dvb")
)
      )
      (princ "\n   <<VBA Stuff Not Loaded>>")
    )

Not sure about the vlx loading though.

Ron

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

uncoolperson

  • Guest
Re: Startup suite alternatives
« Reply #2 on: May 16, 2006, 12:54:35 PM »
i believe autoload is a .lsp thing


Code: [Select]
(load "Modattrel.vlx")
should work for a vlx file (i think)



I think a universal autoload would be a good swamp challenge

Sdoman

  • Guest
Re: Startup suite alternatives
« Reply #3 on: May 16, 2006, 12:57:14 PM »
Regarding the VLX files, you could do this:

(defun c:modatt ()(load "modattrel.vlx")(c:modattl)(princ))

Or redefine AutoLoad to include vlx files...

ELOQUINTET

  • Guest
Re: Startup suite alternatives
« Reply #4 on: May 16, 2006, 01:12:45 PM »
the autoload is working on several .vlx files we have but we also have some custom hatches that have been compiled into a .vlx which are not working using this method and i'm trying to figure out why. so ron i have a few questions. first thing is do i have to create one routine for each i want to load, i'm assuming not . so how do i include mutliple .dvb files to load. where should i put this code. should it be a seperate lisp or in acad.lsp or acad.dvb or an mnl or sigh (out of breath). thanks for the help i'll play around with it awhile and let you know

Chuck Gabriel

  • Guest
Re: Startup suite alternatives
« Reply #5 on: May 16, 2006, 01:19:42 PM »
This is how I handle VBA macros.

Code: [Select]
(defun c:MyCommand ()
  (vl-vbarun "MyProjectFile.dvb!MyMacro")
)

vl-vbarun will load the specified VBA project if it isn't already loaded, and then run the selected macro.

ELOQUINTET

  • Guest
Re: Startup suite alternatives
« Reply #6 on: May 16, 2006, 01:21:00 PM »
i added this to acad.lsp but when i start a new drawing i get the prompt at command line:

<<VBA Stuff Not Loaded>>

this folder is in my supprt path so why isn't it finding and loading it?


Code: [Select]
   (if (findfile "I:\HOME\cadfiles\ACAD\LSP\AngleConnector.dvb")
      (progn
(princ "\n   <<VBA Stuff Loaded>>")
(princ)
(vl-vbaload
 (findfile "I:\HOME\cadfiles\ACAD\LSP\AngleConnector.dvb")
)
      )
      (princ "\n   <<VBA Stuff Not Loaded>>")
    )

Chuck Gabriel

  • Guest
Re: Startup suite alternatives
« Reply #7 on: May 16, 2006, 01:23:22 PM »
If I:\HOME\cadfiles\ACAD\LSP is in you support path, you can shorten that to (findfile "AngleConnector.dvb").

ronjonp

  • Needs a day job
  • Posts: 7531
Re: Startup suite alternatives
« Reply #8 on: May 16, 2006, 01:26:10 PM »
i added this to acad.lsp but when i start a new drawing i get the prompt at command line:

<<VBA Stuff Not Loaded>>

this folder is in my supprt path so why isn't it finding and loading it?


Code: [Select]
    (if (findfile "I:\HOME\cadfiles\ACAD\LSP\AngleConnector.dvb")
      (progn
(princ "\n   <<VBA Stuff Loaded>>")
(princ)
(vl-vbaload
  (findfile "I:\HOME\cadfiles\ACAD\LSP\AngleConnector.dvb")
)
      )
      (princ "\n   <<VBA Stuff Not Loaded>>")
    )

You need to add double slashes or a forward slash in the paths:

Code: [Select]
(if (findfile "I:\\HOME\\cadfiles\\ACAD\\LSP\\AngleConnector.dvb")
     (progn
(princ "\n   <<VBA Stuff Loaded>>")
(princ)
(vl-vbaload
 (findfile "I:\\HOME\\cadfiles\\ACAD\\LSP\\AngleConnector.dvb")
)
     )
     (princ "\n   <<VBA Stuff Not Loaded>>")
   )

or


Code: [Select]
(if (findfile "I:/HOME/cadfiles/ACAD/LSP/AngleConnector.dvb")
     (progn
(princ "\n   <<VBA Stuff Loaded>>")
(princ)
(vl-vbaload
 (findfile "I:/HOME/cadfiles/ACAD/LSP/AngleConnector.dvb")
)
     )
     (princ "\n   <<VBA Stuff Not Loaded>>")
   )

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

ELOQUINTET

  • Guest
Re: Startup suite alternatives
« Reply #9 on: May 16, 2006, 01:29:06 PM »
thanks chuck taking that part out loaded it successfully. i tried your method too and it worked as well. now which is the better method. i'm still listening...

ELOQUINTET

  • Guest
Re: Startup suite alternatives
« Reply #10 on: May 16, 2006, 01:31:24 PM »
aha thanks ron that explains why it works when i take out the full path. so to my other question how can i make it load multiple files?

Chuck Gabriel

  • Guest
Re: Startup suite alternatives
« Reply #11 on: May 16, 2006, 01:35:27 PM »
This is the worst thing that will happen to you if you don't verify the existence of the project file first:

Quote
Command: (defun c:test ()
(_> (vl-vbarun "Fake.dvb!AlsoFake")
(_> )
C:TEST

Command: test

Macro not found."Fake.dvb!AlsoFake"

Having said that, verifying the existence of the project file seems like unnecessary overhead to me.

ELOQUINTET

  • Guest
Re: Startup suite alternatives
« Reply #12 on: May 16, 2006, 01:39:35 PM »
another thing that's in the back of my head is that we have a backup library we switch too from time to time when we are having server problems so i think i should show the full paths and should incorporate those paths as well in case someones profile is not up to date. on a bit of a tangent, is there a way you can tell the program in support path to look in all subfolders. what do you call this recursive??? i currently have about 30 folders i'm looking in but they are all within an acad folder  :ugly:

ELOQUINTET

  • Guest
Re: Startup suite alternatives
« Reply #13 on: May 16, 2006, 02:18:54 PM »
ok i think i've got the vba stuff loading how i want. now for the .vlx stuff. like i said some of the vlx works fine with autoload but the routines i mentioned which are compiled custom hatch patterns do not work either with autoload or load method. what happens is if i type vmdc it says iniatializing over and over. i waited 30 seconds and it was still saying it. not sure what this routine has in it as the guy is no longer here. any thoughts why it isn't initializing?

ronjonp

  • Needs a day job
  • Posts: 7531
Re: Startup suite alternatives
« Reply #14 on: May 16, 2006, 03:05:37 PM »
ok i think i've got the vba stuff loading how i want. now for the .vlx stuff. like i said some of the vlx works fine with autoload but the routines i mentioned which are compiled custom hatch patterns do not work either with autoload or load method. what happens is if i type vmdc it says iniatializing over and over. i waited 30 seconds and it was still saying it. not sure what this routine has in it as the guy is no longer here. any thoughts why it isn't initializing?

I've seen that initializing loop when autoload is used and (AUTOLOAD "75" '("755")) <-- red portion refers to a function not defined in the routine. See if that is your problem.

Here is a little example:

Code: [Select]
(DEFUN C:75 (/)
  (ALERT "I'M A LISP ROUTINE")
)
(AUTOLOAD "75" '("75" "755"));;;should popup alert when 75 is called loop will start if 755 is called

Ron
« Last Edit: May 16, 2006, 03:10:25 PM by ronjonp »

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

ELOQUINTET

  • Guest
Re: Startup suite alternatives
« Reply #15 on: May 16, 2006, 03:45:23 PM »
thank ron but i actually figured out what was going on i believe. i had to trace what routines were utilizing that vlx then have the vlx loaded when i typed those keystrokes. i guess it was looking through my entire search path for a connection that didn't exist. it just hadn't gotten to the end where it scratched its head

ELOQUINTET

  • Guest
Re: Startup suite alternatives
« Reply #16 on: May 16, 2006, 03:48:30 PM »
so the other question i asked is something i've been wondering for awhile now. is there anyway to tell autocad to do a recursive search through all subfolders of a main folder that i put in my supprt path. and if not why. this whole process is an attempt to make configuration a little easier because i inevitably forget something with all there is to do.

ELOQUINTET

  • Guest
Re: Startup suite alternatives
« Reply #17 on: May 16, 2006, 03:55:51 PM »
o i forgot a question i wanted to ask. i like using acaddoc.lsp but would like to move it from program files to where my custom stuff is. if i keep a copy in program files it reads from it first because it is on top in my search path. if i move my custom folder to the top it reads from that but is there any danger in having it read from my custom folder first?

ronjonp

  • Needs a day job
  • Posts: 7531
Re: Startup suite alternatives
« Reply #18 on: May 16, 2006, 04:17:04 PM »
so the other question i asked is something i've been wondering for awhile now. is there anyway to tell autocad to do a recursive search through all subfolders of a main folder that i put in my supprt path. and if not why. this whole process is an attempt to make configuration a little easier because i inevitably forget something with all there is to do.

Take a look here:

http://www.theswamp.org/index.php?topic=9211.msg118838#msg118838

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

ELOQUINTET

  • Guest
Re: Startup suite alternatives
« Reply #19 on: May 16, 2006, 05:22:02 PM »
hmmm thanks ron i printed it out and am looking at it and correct me if i'm wrong but i don't really want to load everything i just want to it to be able to find items in recursive folders when i am loading them on demand. i will look at this more thanks for sharing.

hendie

  • Guest
Re: Startup suite alternatives
« Reply #20 on: May 17, 2006, 03:50:38 AM »
o i forgot a question i wanted to ask. i like using acaddoc.lsp but would like to move it from program files to where my custom stuff is. if i keep a copy in program files it reads from it first because it is on top in my search path. if i move my custom folder to the top it reads from that but is there any danger in having it read from my custom folder first?

I would suggest that you keep the primary acaddoc.lsp where it is. What you can do is keep your secondary acaddoc.lsp, (call it Eloquintetdoc.lsp) and keep that file in your custom folder.
Then in the acaddco.lsp just use (load "mycustomfolderpath\\Eloquintetdoc")
I have a separate file "vbacommands.lsp" where I keep all my vba stuff and I just call that in my acaddoc.lsp ~ (load "vbacommands") ~ keeps things nice and simple.

Regarding your hatch vlx's (I didn't know you could compile a hatch into a vlx so I just learned summat !) ~ are you using autoload for them also ? Doesn't autoload expect both a filename and a command list ? how you apply a command to a hatch pattern ? Have you tried using the plain old "load" command with those files ?

ELOQUINTET

  • Guest
Re: Startup suite alternatives
« Reply #21 on: May 17, 2006, 10:45:33 AM »
hendie to answer part 1 of your comments, that's a good idea but either way i have to manually tell it to load my acaddoc.lsp. i'm not concerned about this for my own station but am trying to eliminate the amount of configuration i have to do on other machines. i guess i could add those lines to everyones acaddoc.lsp files if i really need to. now about you vbacommands.lsp what does that look like? i have added parts to load up each vba from acad.lsp using rons method  but as far as keeping things tidy it would make more sense. what does the code look like? answer #2 i found out from talking to my boss that those vlxs are for hatch routines not hatch patterns. the guy who coded most of the stuff was just paranoid and protected everything. they are just routines which allow you to pick the boundary of various custom mlines we have and it hatches inside.

hendie

  • Guest
Re: Startup suite alternatives
« Reply #22 on: May 17, 2006, 11:22:44 AM »
now about you vbacommands.lsp what does that look like?
Just full of short lisps to call my dvb's
Code: [Select]
(defun C:Cryo (/ Cryo1)
  (setvar "cmdecho" 0)
  (setq Cryo1 "M:/Acad/Utilities/Cryogenics.dvb!GetCryo.ShowCryo")
  (command "vbarun" Cryo1)
  (princ)
)

(defun C:SWB (/ swbd)
  (setvar "cmdecho" 0)
  (setq swbd "M:/Acad/Utilities/Switchboard.dvb!Showsb.Goresb")
  (command "vbarun" swbd)
  (princ)
)
etc etc for each dvb I use

ELOQUINTET

  • Guest
Re: Startup suite alternatives
« Reply #23 on: May 17, 2006, 12:22:19 PM »
aha i see thanks hendie you've been a big help i'll give this a try

ELOQUINTET

  • Guest
Re: Startup suite alternatives
« Reply #24 on: May 17, 2006, 12:48:24 PM »
hendie urrrr i'm having some trouble here. i saved this into a lisp called vbaloader then i loaded it from within acad.lsp. when i drop this lisp into acad no error and when i type vmrefl no error but it does nothing. what does the text following get and show refer to? my macro is called doubleshade. i tried different ways but none seem to be working.

Code: [Select]
(defun C:vmrefl (/ vm)
  (setvar "cmdecho" 0)
  (setq vm "I:\\HOME\\cadfiles\\ACAD\\LSP\\vm_reflected.dvb!Getvm.Showvm")
  (command "vbarun" doubleshade)
  (princ)
)

ELOQUINTET

  • Guest
Re: Startup suite alternatives
« Reply #25 on: May 17, 2006, 12:58:54 PM »
hmmm from looking at your example it should be vmrefl but when i put that it doesn't work

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: Startup suite alternatives
« Reply #26 on: May 17, 2006, 01:12:34 PM »
Oh .. Dan .. I just noticed .. do you use Modatt often?
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

ELOQUINTET

  • Guest
Re: Startup suite alternatives
« Reply #27 on: May 17, 2006, 01:21:06 PM »
ha i was wondering how long it would take you to chime in keith. i don't use it all the time but when i do it's a life saver. i use it mostly for change the color of attributes. i can't figure out why hendies method isn't working. i misread where he wanted me to load  vbaloader from. i was putting it in acad.lsp but have now moved it to acaddoc.lsp and still no go. i'm thinking that i call them from my acad.lsp for now so they load on startup but i would like to figure out how to load them on demand as my .dvb library grows i only have about 5 or so now.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: Startup suite alternatives
« Reply #28 on: May 17, 2006, 01:25:45 PM »
The code to load Showvm
Code: [Select]
(defun C:vmrefl (/ vm)
  (setvar "cmdecho" 0)
  (setq vm "I:\\HOME\\cadfiles\\ACAD\\LSP\\vm_reflected.dvb!Getvm.Showvm")
  (command "vbarun" vm)
  (princ)
)

Now all you need to do is put that code in a lisp by itself and autoload that lisp.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

ELOQUINTET

  • Guest
Re: Startup suite alternatives
« Reply #29 on: May 17, 2006, 03:18:40 PM »
keith without even involving autoload i drop this code in and type vmrefl and nothing happens. that's what i was trying to figure out. if i am trying to run this i type -vbarun;doubleshade 
so doubleshade is the macro name not vm. we are saving the path as vm. o this is too confusing. the whole reason i wanted to explore this way was so i could have a bunch of small routines for loading my vba stuff inside of one lsp file but you are telling me a need a seperate file for each. i think i will stick with putting a few lines of code to load them at startup as i said before. it may not be the best way but it is working.

ELOQUINTET

  • Guest
Re: Startup suite alternatives
« Reply #30 on: May 18, 2006, 09:44:45 AM »
i believe i've got the setup i want for now thanks guys. heres what i got:

i am loading all startup lsp and vba from acad.lsp and i created my own doc.lsp for demand loading and load it from the acaddoc.lsp.

its working great for now thanks again for all the great input

hendie

  • Guest
Re: Startup suite alternatives
« Reply #31 on: May 18, 2006, 09:53:34 AM »
keith without even involving autoload i drop this code in and type vmrefl and nothing happens. that's what i was trying to figure out. if i am trying to run this i type -vbarun;doubleshade 
so doubleshade is the macro name not vm. we are saving the path as vm. o this is too confusing. the whole reason i wanted to explore this way was so i could have a bunch of small routines for loading my vba stuff inside of one lsp file but you are telling me a need a seperate file for each. i think i will stick with putting a few lines of code to load them at startup as i said before. it may not be the best way but it is working.

Eloquintet , according to the code that you provided
Quote
(setq vm "I:\\HOME\\cadfiles\\ACAD\\LSP\\vm_reflected.dvb!Getvm.Showvm")
vm_reflected.dvb = dvb name
Getvm = module name
Showvm = sub or macro name

If doubleshade is the macro name, why did you use Showvm in the code ?


ELOQUINTET

  • Guest
Re: Startup suite alternatives
« Reply #32 on: May 18, 2006, 10:42:39 AM »
ok hendie i'm still a little confused on this so bear with me. when you say module name do you mean the module name as seen in vba editor. if so it says mdl_Draw is the name. doubleshade is the macro name so you are saying i should put showdoubleshade. so do i put the same thing after vbarun doubleshade? and once i have it formatted correctly i can put multiple short routines like this in one large vbatools.lsp. i will play around with this a bit more

ELOQUINTET

  • Guest
Re: Startup suite alternatives
« Reply #33 on: May 18, 2006, 10:51:54 AM »
here is what i have which i thought should work but it's not. i tried to put vbarun doubleshade too and that doesn't work either. i don't know whats going on

Code: [Select]
(defun C:vmrefl (/ vm)
  (setvar "cmdecho" 0)
  (setq vm "I:\\HOME\\cadfiles\\ACAD\\LSP\\vm_reflected.dvb!Getmdl_Draw.Showdoubleshade")
  (command "vbarun" vm)
  (princ)
)

hendie

  • Guest
Re: Startup suite alternatives
« Reply #34 on: May 18, 2006, 11:48:03 AM »
Eloquintet ,
the syntax is: vbarun dvb_name!module_name.macro_name

so if your module is called mdl_Draw and your macro is called doubleshade then you will have

Quote
(setq vm "I:\\HOME\\cadfiles\\ACAD\\LSP\\vm_reflected.dvb!mdl_Draw.doubleshade")