Jump to content

Only tips, please


BlackAlnet

Recommended Posts

Hi, it's me, again... i'm very frustrated, coming here again... But i have a simple thing to do, and i'm not know how to do, or, what is wrong...

 

I wish one day, come here and provide answers, not only questions...Now i have a question...

 

I have a entity, "po", who is a entity, resulting from the "-boundary" command. I want to use the "area" command, and take the coordinates of the entity "po", for set the area... how could i write it properly??

 

 

 

    (setq p (getpoint "\n Selecione area a extrair: "))
    (command "-boundary" p "")
    (setq po (entget (entlast)))
    (entmod po)
    (command "area" (list po) "")
    (setq area (getvar "area"))
    (setq arealst (cons area arealst))

 

 

PS: Sry for bad english, and thanks for the help

Link to comment
Share on other sites

As you asked for only tips I won't re-write your LISP, but rather point you in the right direction:

 

(entlast)

Returns the Entity Name (ename) to be used with the Area command.

 

There is no need to get the Entget Data...

 

Also, you don't need to use "list" with the Area command, you are not supplying it with a list, you are supplying it with an Entity Name :)

Link to comment
Share on other sites

Thanks Lee Mac, you help me "A LOT", many times, i'm very grateful!!!

 

Now, it works properly, yesss, xD!!! I'm soo happy, yuhul

 

(setq p (getpoint "\n Selecione area a extrair: "))
    (command "-boundary" p "")
    (setq po (entlast))
    (command "area" "e" po)
    (setq area (getvar "area"))
    (setq arealst (cons area arealst))

Link to comment
Share on other sites

Yes, i dont want that forum be a "lisp maker" for me. I only want tips, and anything who could help me to learn about lisp more and more

Link to comment
Share on other sites

Have you read the help articles on these functions - they contain a load of information about how to use them :)

 

Are you using the Visual LISP Editor to make your code?

Link to comment
Share on other sites

i am reading "afralisp", and the tutorials from visual lisp editor . i'm using visual lisp too.

 

Now on my job, i only write lisps, simple lisps. I always take a lisp from internet and modify to do what i want the lisp do. That is my 2 lisp, who i write from the begining

 

I want to improve my knowledge, and make better lisps, with "error trapping"

Link to comment
Share on other sites

i am reading "afralisp", and the tutorials from visual lisp editor . i'm using visual lisp too.

 

Now on my job, i only write lisps, simple lisps. I always take a lisp from internet and modify to do what i want the lisp do. That is my 2 lisp, who i write from the begining

 

I want to improve my knowledge, and make better lisps, with "error trapping"

 

Ahhh ok :)

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