AutoCAD Mechanical General Discussion

AutoCAD Mechanical General Discussion

Reply
Contributor
gots
Posts: 12
Registered: ‎08-23-2010
Message 1 of 1 (287 Views)

starting vba macro with ACADM starting

287 Views, 0 Replies
12-09-2010 04:44 AM

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::smileyfrustrated:TARTUP() 

 

;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

 

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.