Jump to content

Recommended Posts

Posted

Hello, I'm new here.

I have little knowledge about visual lisp and I wanted to ask about methods:

; Methods supported:

; AddVertex (2)

; ArrayPolar (3)

; ArrayRectangular (6)

; Copy ()

; Delete ()

; Explode ()

; GetBoundingBox (2)

; GetBulge (1)

; GetExtensionDictionary ()

; GetWidth (3)

; GetXData (3)

; Highlight (1)

; IntersectWith (2)

; Mirror (2)

; Mirror3D (3)

; Move (2)

; Offset (1)

; Rotate (2)

; Rotate3D (3)

; ScaleEntity (2)

; SetBulge (2)

; SetWidth (3)

; SetXData (2)

; TransformBy (1)

; Update ()

What these numbers behind each 'method' mean ? And how to use them?

I tried (vla-put-Offset o (getdist)) but it doesn't work.

Posted

Numbers represent number of arguments required for each method (without main VLA-OBJECT argument) to work...

For ex.

(vla-copy VLA-OBJECT)

(vla-addvertex VLA-OBJECT parameterofsegment (vlax-3d-point pt))

(vla-setbulge VLA-OBJECT parameterofsegment bulgevalue)

...

 

And yes : vla-offset :

(vla-offset VLA-OBJECT value(positve or negative real number) - "not (getdist)")

Posted

Okay, now I understand. But how do you know what type of arguments are required for every method?

does vla-Move require vla-object and 2 points or 1 point and real number ?

Posted

vla-move requires 2 points (base point) and (destination point), of course as variants :

 

(vla-move VLA-OBJECT (vlax-3d-point p1) (vlax-3d-point p2))

 

You have to experiment - I also don't have reference for this, but some things are logical - like command MOVE (so it's the same as with (vla-move))

Posted

This is a very good website mr.Tharwat, thank you for sharing it.

mr.Ribar thank you for helping me out, now I will learn how to deal with these methods.

Posted
This is a very good website mr.Tharwat, thank you for sharing it.

 

You are welcome - happy coding.

Posted

(car (entsel)) just watch out for the vla-add's they require which space its to be added within, but basicly the same as command line.

An example from Afralisp

 

[b];Get the ModelSpace collection of the active document,;select center point and radius: [/b]
[b](setq thisdrawing (vla-get-activedocument (vlax-get-acad-object)))[/b]
[b](setq mspace (vla-get-modelspace thisdrawing))[/b]
[b](setq pt1 (vlax-3d-point (getpoint "\nCenter point: ")))[/b]
[b](setq rad (getreal "\nRadius: "))[/b]
[b][color=#ff0000](vla-AddCircle mspace pt1 rad)[/color] [/b]

Posted

Thank you for mentioning this mr.BIGAL,

But that brings up another question of mine: Is there a way to automatically determine the active space, so the vla-Add method won't cause any problems?

Posted

(vla-get-block (vla-get-activelayout (vla-get-activedocument (vlax-get-acad-object))))

 

This should return mspace VLA-OBJECT if mspace is active...

Posted

Another example I believe from Lee-mac.

 

; I believe from Lee-mac.
(setq doc (vla-get-ActiveDocument
             (vlax-get-Acad-Object))
       spc (if
             (zerop
               (vla-get-activespace doc))
             (if (= (vla-get-mspace doc) :vlax-true)
               (vla-get-modelspace doc)
               (vla-get-paperspace doc))
             (vla-get-modelspace doc)))

Posted (edited)

Heres what I use:

(setq 
acDoc (vla-get-ActiveDocument (vlax-get-acad-object))
AcSpc (vlax-get acDoc (if (= acModelSpace (vla-get-ActiveSpace acDoc)) 'ModelSpace (if (= (vla-get-mSpace acDoc) :vlax-true) 'ModelSpace 'PaperSpace)))
)

Edited by Grrr
Posted
Heres what I use:

(= acModelSpace acDoc)

 

This will never return T: acmodelspace is an enumeration for the activespace property, and you have assigned the activedocument vla-object to the symbol acDoc.

Posted
This will never return T: acmodelspace is an enumeration for the activespace property, and you have assigned the activedocument vla-object to the symbol acDoc.

 

Woops, corrected the above code. Thanks!

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...