Author Topic: Startup suite alternatives  (Read 6103 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