Hi. I am new in customizing autocad. I want vb code that work in Visual Studio 2010 Express to create bundle to load Creating a partial CUI,lisp file and loading it inside AutoCAD 2012 .
Solved! Go to Solution.
If I understand you correctly, you want to create a .lsp file in VB and use it to netload your plugin or do other customizations. If yes all you need to do is overwrite yourprofile\Support\acaddoc.lsp file with something like this and then start an autocad session (it will automatically execute whatever commads you put in the startup section). Note that if there is another autocad session running while your program changes this it, it will attempt to recompile the CUI binary and more than 1 sessions might step on each other. You have to manage that.
Private Const m_acaddoclspFile As String = "acaddoc.lsp" Private Const m_lspFile As String = _ ";;;acad.lsp is loaded once, acaddoc.lsp is loaded for each document," + vbCrLf + _ ";;;s::startup is called after acaddoc.lsp" + vbCrLf + _ ";" + vbCrLf + _ "(DEFUN S::STARTUP () " + vbCrLf + _ " (setvar ""cmdecho"" 0)" + vbCrLf + _ " (command ""_.netload"" ""yourdll.dll"")" + vbCrLf + _ " (setvar ""cmdecho"" 1)" + vbCrLf + _ " (princ)" + vbCrLf + _ ";;(princ "" End s::Startup\n"")" + vbCrLf + _ ")" + vbCrLf + _ vbCrLf + _ ";;; end of file" + vbCrLf
thanks for your replying, my Apologies for late to reply.
blackbox,I am new in customizing autocad. so can you explain to me once once.if you have a time how can I use an Autoloader .bundle
No worries; we all start somewhere.
First, Autoloader may not be the simplest solution, if you are new to it... It may be simpler to manually CUILOAD, and/or add a LOAD statement in your AcadDoc.lsp file, etc. (if you know how to do that?)... However, Autoloader is great at doing a few things really, really well, like automagically loading CUIx, and executable files (like LISP) as specified within the .bundle's configuration.
Autoloader also makes it really easy for others to load your plug-ins (even if only CUIx, and LISP)... Although they (Autodesk) could make it even simpler if they'd allow for .bundles to be placed on the network instead of relegating to %AppData%, etc. (but that's another topic altogether).
To learn more about Autoloader, see the 'Autoloader White Paper' link in my signature - I reference this often, especially when first learning about the Autoloader mechanism.
In the short term, perhaps you could post your CUIx, and LISP, and I can help by setting up an Autoloader .bundle for you, that you can test out, and refine on your end.
Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register
Start with some of our most frequented solutions to get help installing your software.