.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Creating a partial CUI,lisp file and loading it inside AutoCAD

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
m_badran
3136 Views, 6 Replies

Creating a partial CUI,lisp file and loading it inside AutoCAD

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 .

Regards,
mostafa

6 REPLIES 6
Message 2 of 7
sszabo
in reply to: m_badran

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

 

Message 3 of 7
BlackBox_
in reply to: m_badran

Must you load the CUIx, and LISP with code?

 

Why not just use an Autoloader .bundle?



"How we think determines what we do, and what we do determines what we get."

Message 4 of 7
m_badran
in reply to: sszabo

thanks for your replying, my Apologies for late to reply.
sszabo. I Am not create .dll not yet I want vb code to do that. to load cui in autocad and lode lisps.
thanks
Message 5 of 7
m_badran
in reply to: BlackBox_

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
Message 6 of 7
BlackBox_
in reply to: m_badran


@mostafabadran wrote:
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.

 

Cheers



"How we think determines what we do, and what we do determines what we get."

Message 7 of 7
m_badran
in reply to: BlackBox_

Thank you so much, that gives me the honor to take a look at my cui and lisp.
thank you for your positive reply, i will post my cui and lisp to take a look at them.

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost