Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Run lisp at Cad start-up question

1 REPLY 1
Reply
Message 1 of 2
Anonymous
196 Views, 1 Reply

Run lisp at Cad start-up question

I need to run a lisp command when cad loads. I am able to get it to load and run but I am getting an error(AutoCAD menu utilities loaded.; error: Automation Error. Description was not). The routine is needed to make sure the 2 profiles needed are imported at the start of Autocad. Any help you guys can provide would be awesome.

Below is the lisp

Thank you

Tim

(defun S::Startup ()
(vl-load-com)
(vla-importprofile (vla-get-profiles (vla-get-preferences (vlax-get-acad-object))) "PlayworldCAD3D" (strcat "C:\\PSICAD\\Utilities\\" "PlayworldCAD3D.arg") 1)
(vla-importprofile (vla-get-profiles (vla-get-preferences (vlax-get-acad-object))) "PlayworldCAD2D" (strcat "C:\\PSICAD\\Utilities\\" "PlayworldCAD2D.arg") 1)
)
1 REPLY 1
Message 2 of 2
Anonymous
in reply to: Anonymous

if startup has already been defined you need

(defun-q S::Start-up ()
...
)

see help in vlisp for more info on defun-q and adding to compiled routines.

you may also want to consider creating your own list and appending it to the existing startup:

(defun-q mystartup ()
...
)

(if S::Startup
(setq S::Startup (append S::Startup mystartup))
(setq S::Startup mystartup)
)

Gary

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


Autodesk Design & Make Report