TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Craig on November 18, 2003, 04:51:32 PM
-
Aiight guys, I am about to tackle the task of learning the new VLisp and will be asking bunches of questions. What I want to know to start is where can I find the property values for the line below.
(vlax-get-property doc 'FullName)
'Fullname
'Modelspace
'Color
etc.. Where can I find a list of these values that can be called for?
Remember, this is just the start
-
In the help file, there is a reference called "ActiveX and VBA Reference". In there you will find what you are looking for, but you'll need to use (vlax-get-acad-object), which you'll find under v of the Autolisp reference. If you're in the vlide and you inspect (vlax-get-acad-object), you'll get a list popup with all the properties of the acad database, which is what that is. You can double click on properties in the popup and see what's nested. You use (vla-get-activedocument (vlax-get-acad-object)) to access the drawings object model. Hope that helps you start.
-
check this out.
(setq doc (vla-get-activedocument (vlax-get-acad-object)))
(vlax-dump-object doc)
-
Here ya go Craig, Ill give you a compariative study to do also. Study these lisps and they should get you started down the right path in the help files. The first one is easy (You alreay know how to do that. but I have to put it in the post just cause...) The second is the equiliviant of the first. Study each "vl" expression untill you know them like the back of your hand and you will understand better.
(Thats important! Study each "vl" expression and you will have a god start to the Vl-stuff.)
(defun c:AMove ()
(setvar "cmdecho" 0)
(setq ent (entsel)
pt1 (getpoint "\nEnter first point: ")
pt2 (getpoint "\nEnter second point: "))
(command "_.move" ent "" pt1 pt2)
(setvar "cmdecho" 1)
(princ)
)
(defun c:vl-Move ()
(vl-load-com)
(setq ent (entsel)
entname (car ent)
entobj (vlax-ename->vla-object entname)
pt1 (getpoint "\nEnter first point: ")
pt1obj (vlax-3d-point pt1)
pt2 (getpoint "\nEnter second point: ")
pt2obj (vlax-3d-point pt2))
(vla-move entobj pt1obj pt2obj)
(vlax-release-object entobj)
(princ)
)
-
.. or it could be wtitten like this, with no variables :--
(vl-load-com)
(defun c:xxx-Move ()
(vla-move (vlax-ename->vla-object (car (entsel)))
(vlax-3d-point (getpoint "\nEnter first point: "))
(vlax-3d-point (getpoint "\nEnter second point: "))
)
(princ)
)
-
I know that, You know that, and he knows that. Thats fine and dandy, but that isnt the point. I used "Proper" format for a reason.
-
Hey, thanks John. This will really help me get started. When I'm typing this new program out I still out of habit put in autolisp code that I've been doing for years. Gotta get out of that habit.
-
No problem. Yeah, that will go away when you change your mode of thinking a bit towards the "Object/Properties" instead of "Ent/Associations".
-
Oh, side note: I found it hard to go back; A little while ago, i was on this kick of creating functions that would do things the "old way". (Watch this craig, Daron and Stig are gonna go at it again. {Daron called Autolisp "old" once and i could almost see stig's eyes open wide in confusion} ...lmao) I was checking to see if there was a circle in a block and see the circ's props with assoc code. That got a bit tricky; I couldnt remeber anything. lol
-
Nah, I don't think we'll go at it again. I admit defeat. He put me in my place. Reading his site'll do that. As far as it being old, it is. Isn't lisp the second oldest language? I don't even know what the oldest language is. From the tests we've driven on this site, my eyes have been opened to considering what will work quickest when I have to code for speed. Some "old" functions are still superior to the new activeX. Even VBA seems to be slower than lisp. Heh!
-
Bawahahaha!
I think it is fortran.
Daron, why is ActiveX is slower then lisp? (why do you think it is the way it is.)
-
:shock:
I know there ain't line numbers in BASIC anymore .. BUT!
-
That's what I was thinking, but 'm not sure. Is fortran a dead language?
-
I have a fortran compiler. Its still used.
-
There are many languages older than LISP - just think of how Ada got it's name! LISP is merely the second oldest language still in use.
-
Daron, why is ActiveX is slower then lisp? (why do you think it is the way it is.)
Because it was written in the 80's by Bill and Company? Bunch o' pot smokers.
-
There are many languages older than LISP - just think of how Ada got it's name! LISP is merely the second oldest language still in use.
Ah! That I didn't know. What's Ada?
-
Because it was written in the 80's by Bill and Company? Bunch o' pot smokers.
Nope. Why is AutoLisp faster then ActiveX in AutoCAD?
-
I think Fortran is one of the oldest. You guys remember QBasic? :lol:
-
ActiveX ain't that old, maybe 4 years ago.
>Bunch o' pot smokers
Yea, a bunch of VERY wealthy pot smokers. You can say what you want about Mr. Gates and his Windows OS, but you don't get that rich by being stupid.
-
Ada is a high level language (chosen as standard by your DoD in '79).
The name comes from Ada Lovelace (one of Lord Byron's oopses) who got fascinated by Babbage's algebra machines and set up a "language" .. or at least some methods .. to program them.
That was in 1830's or there about
-
Craig and anybody else wanting to get started with Vlisp, there are a few great sites as well a few easy to follow tutorials like this one (http://www.theswamp.org/phpBB2/viewtopic.php?t=17), written by Mark himself. So, if you have a moment to spare, you might have a look in the Teach Me forum. It's the place for turorials.
-
I can still remember turning in those damn punch cards for Fortran class at USF.
But i did love Apple Basic and 6502 machine language, my cassette was the only
permanent memory for my Apple until I got my first floppy drive.
Ahhhh the good old days.
Who ever said that was nuts.
CAB (almost as old as t-bear)