Jump to content

Finding Visual Lisp Functions


The Buzzard

Recommended Posts

I am wondering if anyone could help here. I was looking thru the Developer Help Section in AutoCAD's help documentation and came across Visual Lisp Functions that start with the prefixes:

 

vl

vlax

vlr

 

However there does not seem to be many. I have also seen some functions start with (vla) that are not listed at all. This seems to be confusing to me.

 

Where do you get all these functions from?

Is there an index where they can be found?

 

I am sure these functions are not randomly made up and should be a complete listing somewhere.

Any clarification would be very helpful.

Link to comment
Share on other sites

  • Replies 33
  • Created
  • Last Reply

Top Posters In This Topic

  • The Buzzard

    15

  • Lee Mac

    11

  • rkmcswain

    3

  • Se7en

    2

Top Posters In This Topic

Posted Images

They are all documented in the Developers Guide (\Help\acad_dev.chm), more specifically, the "AutoCAD ActiveX and VBA Reference"

 

Thank you, I will check that out. I was under the impression that it was for VBA only.

Link to comment
Share on other sites

The Visual LISP Editor Help files are written with VBA in mind, so you may have to make a few "links" between the two.

 

for example:

 

Type this in the VLIDE:

 

vla-get-layer

 

You will see it turn blue.

 

Double click on it so that the whole function is selected, then click on the help button.

 

You will see a page detailing the "layer" property, giving information on arguments and returns of this property.

 

In the contents page of the VLIDE, have a look at the Active X and VBA Reference - there you will see a list of all the properties and methods available to you :)

 

ex.png

 

 

 

Lee

Link to comment
Share on other sites

The Visual LISP Editor Help files are written with VBA in mind, so you may have to make a few "links" between the two.

 

for example:

 

Type this in the VLIDE:

 

vla-get-layer

 

You will see it turn blue.

 

Double click on it so that the whole function is selected, then click on the help button.

 

You will see a page detailing the "layer" property, giving information on arguments and returns of this property.

 

In the contents page of the VLIDE, have a look at the Active X and VBA Reference - there you will see a list of all the properties and methods available to you :)

 

[ATTACH]13249[/ATTACH]

 

 

 

Lee

 

Lee,

 

This Visual Lisp seems like a guessing game. The resources available are very confusing to know what is what.

Link to comment
Share on other sites

Lee,

 

This Visual Lisp seems like a guessing game. The resources available are very confusing to know what is what.

 

You need to experiment with it a bit I find, yes.

Link to comment
Share on other sites

From what I can tell

 

vlax- = Object level

vlr - = Event

vla - = Methods & Properties of objects

 

Open the vbaide with this an mind and go wild for a bit

 

I may be wron right enough

 

Ollie

Link to comment
Share on other sites

From what I can tell

 

vlax- = Object level

vlr - = Event

vla - = Methods & Properties of objects

 

Open the vbaide with this an mind and go wild for a bit

 

I may be wron right enough

 

Ollie

 

Thank You ollie,

That is very helpful.

Link to comment
Share on other sites

I wrote up something on the differences once. I will have to look around for that. I cant promise anything though; that article would be 5 or 6 hard drives and several years ago.

Link to comment
Share on other sites

vlax-curve functions are really good to look into... takes all the messiness out of DXF tables with objects.

 

 

Thanks Lee,

 

It is at this point a bit beyond me though. I still cannot make heads or tails out of the VBA section and how this relates to VL. It seems all trial and error to me at this point, But maybe I am trying to get to far ahead of myself.

 

Patience I guess

Link to comment
Share on other sites

I wrote up something on the differences once. I will have to look around for that. I cant promise anything though; that article would be 5 or 6 hard drives and several years ago.

 

Thanks Se7en,

 

I appreciate anything that can clear up some of the mystery behind VL.

Link to comment
Share on other sites

The Curve functions are well documented, and will also work with Entity Names, as well as VLA-Objects - definitely worth a look.

 

just search for vlax-curve-, in the help files. :)

 

EDIT:

 

A great overview is the Section "Curve Measurement Functions" in the Developers Guide.

Link to comment
Share on other sites

The Curve functions are well documented, and will also work with Entity Names, as well as VLA-Objects - definitely worth a look.

 

just search for vlax-curve-, in the help files. :)

 

EDIT:

 

A great overview is the Section "Curve Measurement Functions" in the Developers Guide.

 

I will give it a look, But I have had no sucess finding VL functions except for those listed in the AutoLISP Reference for AutoLisp Functions. My resouces for VL seems very limited.

Link to comment
Share on other sites

All the necessary functions are listed.

 

For example, to change a property of an object, you can use:

 

([color=Blue][b]vlax-put-property[/b] [/color][color=Red][i]obj [/i][i]property[/i][i] arg[/i][/color])

Which is documented, and has the same functionality as:

 

([color=Blue][b]vla-put-[color=Red]<property>[/color][/b][/color] [color=Red][i]obj property arg[/i][/color])

As an example:

 

[b]Obj is a Circle VLA-Object[/b]
[color=Blue][b]
(vla-put-layer Obj "0")[/b][/color]

is the same as:
[b][color=Blue]
(vlax-put-property Obj 'Layer "0")[/color][/b]

The same with the methods:

 

([color=Blue][b]vlax-invoke-method[/b][/color] [i][color=Red][i]obj [/i][i]method[/i][i] arg [arg...][/i][/color][/i])

And

 

([color=Blue][b]vla-[/b][/color][color=Red][b]<method>[/b][/color] [color=Red][i]Obj arg [arg...][/i][/color])

Are the same, or even just

 

([color=Blue][b]vlax-invoke[/b][/color][color=Red][i] Obj arg [arg...][/i][/color])

Although the above has the same functionality, it will return data in AutoLISP data types, as opposed to VLA data types such as Variants and Safearrays.

 

If I have missed something, anyone feel free to chime in :)

 

Lee

Link to comment
Share on other sites

Part of what you have shown me is my point. How am I suppose to know this if I do not understand the difference between VL, VLA, VLAX & so on and so forth. I am not sure where or how each is used, But maybe I have not reach that point yet in learning this. Maybe I am learning backwards. Not sure.

 

I have seen other prefixes used that are not shown in the help section at all. A very dry type read Im afraid.

 

If I were to read the entire help section for VL, I would still draw blanks on these issues since I cannot find the resources that I need to help understand this stuff.

 

Everyone has their own methods of learning. I prefer to test functions to see what they do and draw on my own conclusions.

Link to comment
Share on other sites

All I am saying is that there is not much that you cannot do just using the functions documented in the help files. :)

 

 

EDIT:

 

Forgot to mention, so see a list of functions available, use the Apropos in the VLIDE -

 

for example: type "vl" and hit Ctrl-Shift-Space :)

Link to comment
Share on other sites

All I am saying is that there is not much that you cannot do just using the functions documented in the help files. :)

 

I realize that. But they help to get a better understanding. To learn regular lisp each function is documented and has examples for their usage with the expected type of return values you would encounter.

And its nicely arranged.

 

Visual Lisp on the other hand is like doing a cross-word puzzle with a blind fold on with the help section thats available.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...