Hello again.
I am wanting to get serious about learning lisp writing through VLA callouts [compared to "(command..."], does anyone have a one-stop resource to learn VLA? My appologies if this topic has been posted/answered elsewhere. There are a few scripts I've used which use VLA and am just wanting to find a place I can go to right away as well as later down the line in a couple months. Thank you in advance!
In my opinion, where ActiveX is concerned, the only resource you really need is the ActiveX & VBA Reference - this is provided with AutoCAD in the form of the acadauto.chm file (this can usually be access directly from within the Visual LISP IDE using the method described here), or the reference may also conveniently be found online here.
Of course, this reference is only a valuable resource if you know how to make full use of it - for that, I have written a short tutorial which may be found here.
I hope this helps!
This might help. I haven't read it myself and so cannot comment on its worth.
http://forums.autodesk.com/autodesk/attachments/autodesk/130/249856/
The Visual LISP
Developers Bible
2003 Edition
By David M. Stein
These are perfect. Thank you guys!
I will be able to dive into the pdf sometime tomorrow and can let ya know asap.
I've been trying out the various mentionings in Lee's tutorial. Thus far I've only understood
writing through straight .txt editor. In about an hour, was able to come up with this simple matchprop function from scratch utilizing the vlisp console. Once back at work tomorrow, I'll go into the pdf and expand this for vlax use on the matchprop portion, there's some minor error happening if 'no' is selected. An inch here and there can make a mile, but haste + knowledge can create time.
(defun c:mla (/ ob0 p1 p2 ob1 Y N) (while (not (and (setq ob0 (car (entsel "\nSelect source object: ")))) );not (prompt "\nNothing Selected.") );while (setq p1 (getpoint "\nPick first corner: ")) (setq p2 (getcorner p1 "\nPick second corner: ")) (setq ob1 (ssget "W" p1 p2 '((0 . "*")))) (initget 1 "Y N") (setq option (getkword "\nMultiple? (Yes/No): ")) (if (= option "Y") (command "matchprop" ob0 ob1);'no' (command "matchprop" ob0 ob1 "");'yes') );if );defun
@ksmith84 wrote:I've been trying out the various mentionings in Lee's tutorial. Thus far I've only understood
writing through straight .txt editor. In about an hour, was able to come up with this simple matchprop function from scratch utilizing the vlisp console.
You're entirely welcome ksmith
Regarding the Visual LISP IDE, if you are just starting out, I would recommend reading through the following tutorials so that you can exploit its full capabilities:
The Visual LISP Editor - Part 1
The Visual LISP Editor - Part 2
An Introduction to the Visual LISP IDE
Retrieving Information About a Function
A Shortcut to Localising Variables
Debugging Code with the Visual LISP IDE
As for the code, I'm not quite sure of the desired behaviour, but perhaps something along the lines of:
(defun c:mla ( / ob0 ob1 p1 p2 ) (if (and (setq ob0 (car (entsel "\nSelect source object: "))) (setq p1 (getpoint "\nPick first corner: ")) (setq p2 (getcorner p1 "\nPick second corner: ")) (setq ob1 (ssget "_W" p1 p2)) ) (progn (initget "Yes No") (if (= "Yes" (getkword "\nMultiple? [Yes/No] <No>: ")) (command "_.matchprop" ob0 ob1) (command "_.matchprop" ob0 ob1 "") ) ) ) (princ) )