Jump to content
GregGleason

Help with Entlast

Recommended Posts

GregGleason

I think "entlast" doesn't do what I thought.  I moved an object and the "entlast" object went to the last created object rather than the object I just moved.

   (setq ttt (vlax-ename->vla-object (entlast)))

 

So I tried to go to the object directly by a region and that failed.

   (setq ttt (vlax-ename->vla-object (ssget "_C" '(15.3 0.58) '(15.2 0.57) '((0 . "ATTDEF")))))

What is the proper way to do this?

 

Also, I tried to find something about "entlast" so I could learn but did not find anything useful.  If someone has a link that's helpful then please let me know.

 

Greg

Share this post


Link to post
Share on other sites
dlanorh
Posted (edited)
18 minutes ago, GregGleason said:

I think "entlast" doesn't do what I thought.  I moved an object and the "entlast" object went to the last created object rather than the object I just moved.


   (setq ttt (vlax-ename->vla-object (entlast)))

 

 

"Entlast" IS the last created object in the database.

 

Quote

 

So I tried to go to the object directly by a region and that failed.


   (setq ttt (vlax-ename->vla-object (ssget "_C" '(15.3 0.58) '(15.2 0.57) '((0 . "ATTDEF")))))

What is the proper way to do this?

 

 

If this is an attribute in a block reference you can select it directly using the "nentsel" function. Otherwise you access it indirectly by selecting the block or iterating the block table depending on what you are trying to achieve.

Edited by dlanorh

Share this post


Link to post
Share on other sites
GregGleason

Thanks dlanorh.

 

This is the code that I wound up using:

 

   (setq ss1 (ssget "_C" '(15.3 0.58) '(15.2 0.57) '((0 . "ATTDEF"))))
   (setq ttt (vlax-ename->vla-object (ssname ss1 0)))

It's probably not super elegant, but it worked.

Share this post


Link to post
Share on other sites
ronjonp
Posted (edited)
13 hours ago, GregGleason said:

Also, I tried to find something about "entlast" so I could learn but did not find anything useful.  ,,,

Are you serious?

 

What about starting HERE.

TheSwamp has a help file that covers most functions too.

If you use the VLIDE ( which you should ) highlight the function you want to lookup, then CNTRL+SHIFT+A and you will get the help file.

image.png.b6ee167154be6c6f8003d156346a7c97.png

And of course there is just a simple Google search.

image.thumb.png.971a6067f4339a4c671058185f63392a.png

 

HTH.

Edited by ronjonp

Share this post


Link to post
Share on other sites
Lee Mac

Nice one Ron - also this.

Share this post


Link to post
Share on other sites
marko_ribar
Posted (edited)

I don't believe that (entlast) returns last created entity... It's some kind of bug, but not explained through documentation... It may return last entity, but not always...

[EDIT : (entlast) returns always last created object - not entity as function name states...]

Look here :

http://www.theswamp.org/index.php?topic=53819.0

And also there is this topic with similar symptom :

https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-with-entsel/m-p/8565775#M380396

 

For first link, you have to be logged to be able to download attachments relevant to the topic...

HTH., M.R.

Edited by marko_ribar

Share this post


Link to post
Share on other sites
GregGleason
On 4/10/2019 at 8:55 AM, ronjonp said:

Are you serious?

 

What about starting HERE.

TheSwamp has a help file that covers most functions too.

If you use the VLIDE ( which you should ) highlight the function you want to lookup, then CNTRL+SHIFT+A and you will get the help file.

image.png.b6ee167154be6c6f8003d156346a7c97.png

And of course there is just a simple Google search.

image.thumb.png.971a6067f4339a4c671058185f63392a.png

 

HTH.

 

Thanks ronjonp for the extra information.  I should have also said that I did find the other the Autodesk info (poor Google Fu on my part) so that I began to get the idea.

The other resources you provided I will look into and start doing homework.  I appreciate the time you took to educate me, and I don't take that for granted, so "thank you" again for pointing me in the direction and the additional resources where I can educate myself.

 

Greg

Share this post


Link to post
Share on other sites
GregGleason
On 4/10/2019 at 11:36 AM, Lee Mac said:

Nice one Ron - also this.

 

Well that's very helpful!  Thanks Lee!

Share this post


Link to post
Share on other sites
GregGleason
On 4/10/2019 at 12:20 PM, marko_ribar said:

I don't believe that (entlast) returns last created entity... It's some kind of bug, but not explained through documentation... It may return last entity, but not always...

[EDIT : (entlast) returns always last created object - not entity as function name states...]

Look here :

http://www.theswamp.org/index.php?topic=53819.0

And also there is this topic with similar symptom :

https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/help-with-entsel/m-p/8565775#M380396

 

For first link, you have to be logged to be able to download attachments relevant to the topic...

HTH., M.R.


Interesting.  Thanks for the heads up marko_ribar on the potential issues.

Share this post


Link to post
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
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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