Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
New Member
subhesh_999
Posts: 2
Registered: ‎08-06-2012
Message 1 of 8 (298 Views)

what is macros? Customization using macros...

298 Views, 7 Replies
08-06-2012 05:02 AM

hi!

could anyone tell me about how to crate macros of a drawing and then hw can we change the drawing by editing the macro please. E.g.. I have drawn a circle of 30 mm dia.. than need to crate macros for same and then by changing the dia of circle in macros I want to create new circle of 50 mm dia.

 

Another thing I wanted to ask is what is difference between visual lisp and visual basic.

 

Which is easier??

Distinguished Mentor
gasty1001
Posts: 578
Registered: ‎04-11-2010
Message 2 of 8 (279 Views)

Re: what is macros? Customization using macros...

08-06-2012 01:32 PM in reply to: subhesh_999

Hi,

 

Why do You need a macro for a task that it's easy for a command sequence like circle-radius and then copy multiple?

 

Autolisp is a high level programming language (by Autodesk) interpreted by AutoCAD (full or any AutoCAD based vertical product), it's based on LISP, and Visual Lisp is an extension to Autolisp that permit acces to COM exposed objects, and have some other improvements.

 

Visual Basic, if you mean for that VB/VBA,  is a programming language by Microsoft  that Autodesk  exposed to a model object of the dwg database that permit access to method and properties of AutoCAD objects with some OOP capabilities and with a good tool set for GUI design, but with very poor support (VBA) for 64 bit platforms . For other side there is VB .NET that it's a completely different thing with  full OOP capabilities and a complete tool set for GUI design (Windows Forms and WPF)

 

As for which one is more easy, it's allways depend on  personal issues, but if you have no knowledge about programming I'll choose AutoLisp/Visual Lisp  as it's more easy to learn and with native integration with AutoCAD. VB/VBA are beign deprecated (in AutoCAD)  in some way, so I think it does not deserve an effort to learn it. VB .NET it's a more (much) powerfull tool, but requires more knowledge or experience in OOP and system architecture to master it, also You will need MS VS  ( there are some free replacemente but with a trade-off) to program in VB .NET.

 

Finally, you can check this link that explain a lot of this: http://adndevblog.typepad.com/autocad/2012/07/the-right-tools-for-the-job-autocad-part-1.html

 

Gaston Nunez

*Expert Elite*
scot-65
Posts: 2,204
Registered: ‎12-11-2003
Message 3 of 8 (267 Views)

Re: what is macros? Customization using macros...

08-06-2012 04:03 PM in reply to: subhesh_999

VL and LISP are internal to AutoCAD. What you create here (for the most part)

can be used on other workstations without extra (external) loading of software.

 

VB and C are windows environments that *usually* require

some sort of application to be externally loaded on each

work station in order for the program to be run.

An ARX type file comes to mind. Don't go there (yet).

 

Judging by your number of posts, and the tempo of your inquiry, learn LISP, then VL.

 

A macro can also be called a script.

It is a chain of keystrokes all on one line.

Look into toolbars and pull-downs to further understand macros.

A semi-colon ";" is equal to [Enter], ^C^C is [Esc][Esc], Backslash "\" is pause for

user to select a point on the screen, a negative "-" in front of command name does

not bring up the command's dialog box, etc. (you get the idea...)

 

Good Luck!

Scot-65
Dyslexia is a permanent physical disability that cannot be seen.
Introverts is proof that there is indeed intelligent life on this planet.
*Expert Elite*
Kent1Cooper
Posts: 5,788
Registered: ‎09-13-2004
Message 4 of 8 (258 Views)

Re: what is macros? Customization using macros...

08-06-2012 08:28 PM in reply to: scot-65

scot-65 wrote:

.... 

A macro can also be called a script.

It is a chain of keystrokes all on one line.

.....


Macros and Scripts may share some characteristics in common [e.g. every character counts, including spaces, unlike in AutoLISP], but they are not the same:
 

Scripts can't take user input [they have nothing equivalent to \ in macros or pause in Lisp (command) functions].

Scripts don't use semicolons for Enter, but Enter itself [or a space where that's equivalent in a particular command].

Scripts don't recognize ^C as cancel.

Scripts can often be on one line, but won't be if Enters are used, and can't be if any command requires Enter rather than a space to complete something, such as at the end of Text content.

Macros are defined within your menu file, whereas Scripts are always external .scr files that must be invoked with the Script command.

....and probably a couple of other differences....

Kent Cooper
New Member
subhesh_999
Posts: 2
Registered: ‎08-06-2012
Message 5 of 8 (237 Views)

Re: what is macros? Customization using macros...

08-07-2012 06:56 AM in reply to: gasty1001

hi!

 

thanks for information.

 

Actually i am not want to chnge the dia of circle using macros.

 

I have to develope a code to generate beziur curve in AutoCAD and then want to generate even beziur surface.

 

I am moderately aware of AutoLISP.

 

what do you think wht is the right technology to work in for this task?

 

*Expert Elite*
scot-65
Posts: 2,204
Registered: ‎12-11-2003
Message 6 of 8 (219 Views)

Re: what is macros? Customization using macros...

08-07-2012 03:09 PM in reply to: Kent1Cooper

It is best if you stick to just helping out the OP instead of trying to bash everyone who IS helping.

Scot-65
Dyslexia is a permanent physical disability that cannot be seen.
Introverts is proof that there is indeed intelligent life on this planet.
*Expert Elite*
Kent1Cooper
Posts: 5,788
Registered: ‎09-13-2004
Message 7 of 8 (214 Views)

Re: what is macros? Customization using macros...

08-07-2012 04:52 PM in reply to: scot-65

scot-65 wrote:

It is best if you stick to just helping out the OP instead of trying to bash everyone who IS helping.


Well....  On a thread that's asking what macros are about, I don't consider it "helping" to suggest that they are the same as Scripts, when they are unequivocally not.  I corrected that piece of misinformation because I felt it would be helpful.  If that is considered "bashing," I will continue to bash away when it seems appropriate.  Please bash back when I post something erroneous -- I will appreciate knowing that I have done so, and having my misinformation corrected so others are not misled.

Kent Cooper
Distinguished Mentor
gasty1001
Posts: 578
Registered: ‎04-11-2010
Message 8 of 8 (204 Views)

Re: what is macros? Customization using macros...

08-07-2012 08:32 PM in reply to: subhesh_999

Hi,

 

I think you can try with Autolisp/Visual Lisp, as it have a good tool set for curve derivated objects(check the vlax-curve-XX functions in the docs), but i'm not sure about surfaces, may be you will need to jump into .NET to acomplish your task.

 

Gaston Nunez

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!