AutoCAD Mechanical Forum
Welcome to Autodesk’s AutoCAD Mechanical Forums. Share your knowledge, ask questions, and explore popular AutoCAD Mechanical topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

starting vba macro with ACADM starting

0 REPLIES 0
Reply
Message 1 of 1
gots
443 Views, 0 Replies

starting vba macro with ACADM starting

Hi

I'm looking to a way to start a specific macro written in VBA when ACADM is started.

I have added in folder "C:\Program Files\Autodesk\ACADM 2010\Acadm" a file named acad.lsp that contains this lines :

 

;startup for application ACADM, installed xxxxxxx
(princ (load "gen/acadm.lsp" "\nError: acadm.lsp not loaded!"))
;(if acadmappend (setq s::startup (acadmappend s::startup)))
;@udros initialization
(princ (load "gen/au_startup.lsp" "\nError: au_startup.lsp could not be loaded!"))

 

;startup for application ACADM, installed xxxxxxx(princ (load "gen/acadm.lsp" "\nError: acadm.lsp not loaded!"));(if acadmappend (setq s::startup (acadmappend s::startup)))
;@udros initialization(princ (load "gen/au_startup.lsp" "\nError: au_startup.lsp could not be loaded!"))

 

and a file named au_startup.lsp in subfolder gen that contains this lines :

 

 

(defun S::STARTUP() 

 

;Add the correct path to AcadInterface.dvb here

 

(setq auHome6 (getenv "AU_HOME_6"))

(setq auHome6 (strcat auHome6 "\\CAD\\Async\\AutoCad\\AcadInterface.dvb"))

 

(vl-vbaload auHome6)

(vl-vbarun "Layer3_MainProcesses.AcadStartup")

 

The macro function is started well. This function will create a new menu in ACADM.
This is working well, BUT, some standard function in ACADM are disabled !!. I cannot for example draw a construction line for example. I have to close the current drawing and start a new one to get this function back.
If I go in ACAD and use thle Menu Tools and load an application. ACADM will load myVBA project. I will start manualy the function "Layer3_MainProcesses.AcadStartup", the menu will be correctly added and I haven't any trouble in ACADM !.
So, is there another way to start a specific function during ACADM starting ???
Thanks for you help
Gots

 

0 REPLIES 0

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

Post to forums  

Autodesk Design & Make Report

”Boost