.NET

Reply
Contributor
mostafabadran
Posts: 18
Registered: ‎10-31-2013
Message 1 of 7 (1,465 Views)
Accepted Solution

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

1465 Views, 6 Replies
11-19-2013 08:56 AM

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


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

Valued Contributor
sszabo
Posts: 86
Registered: ‎09-05-2012
Message 2 of 7 (1,450 Views)

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

11-19-2013 10:56 AM in reply to: mostafabadran

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

 

Distinguished Mentor
BlackBox_
Posts: 785
Registered: ‎02-25-2013
Message 3 of 7 (1,437 Views)

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

11-19-2013 12:10 PM in reply to: mostafabadran

Must you load the CUIx, and LISP with code?

 

Why not just use an Autoloader .bundle?



"Potential has a shelf life." - Margaret Atwood


Autodesk Exchange Apps ~ Autoloader ~ AutoCAD Security


AutoCAD® 2014, and Civil 3D® 2014 Certified Professional ~ Autodesk® Authorized Developer

Contributor
mostafabadran
Posts: 18
Registered: ‎10-31-2013
Message 4 of 7 (1,425 Views)

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

11-19-2013 01:31 PM 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
Contributor
mostafabadran
Posts: 18
Registered: ‎10-31-2013
Message 5 of 7 (1,425 Views)

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

11-19-2013 01:32 PM 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
Distinguished Mentor
BlackBox_
Posts: 785
Registered: ‎02-25-2013
Message 6 of 7 (1,416 Views)

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

11-19-2013 01:54 PM in reply to: mostafabadran

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



"Potential has a shelf life." - Margaret Atwood


Autodesk Exchange Apps ~ Autoloader ~ AutoCAD Security


AutoCAD® 2014, and Civil 3D® 2014 Certified Professional ~ Autodesk® Authorized Developer

Contributor
mostafabadran
Posts: 18
Registered: ‎10-31-2013
Message 7 of 7 (1,410 Views)

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

11-19-2013 02:16 PM 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.
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!