Jump to content

Recommended Posts

Posted

Hi guys,

I wanted to ask this:

Is there a way to perform "entsel" and "nentsel" at the same time (with one click) ?

For example I'm trying to pick a nested line from a dynamic block,

and I'm trying to store line's entity name block's entity name.

Command: (entsel)
Select object: (<Entity name: 7ff64b74d980> (58158.7 46703.2 0.0))

I've realized that (cdr (entsel)) would returns the coordinates of the user's picked point, but would it be possible to invoke nentsel and apply/simulate the same picked point?

  • Replies 21
  • Created
  • Last Reply

Top Posters In This Topic

  • Grrr

    7

  • Lee Mac

    6

  • Tharwat

    4

  • ibach

    4

Top Posters In This Topic

Posted

Maybe something like this - instead of nentsel - use nentselp and look for differences between those two different outputs (nentsel/nentselp) :

 

(defun c:pick ( / es ns )
 (setq es (entsel "\nPick an entity..."))
 (setq ns (nentselp (cadr es)))
 (prompt "\nEntsel data : ")
 (princ es)
 (prompt "\nNentselp data : ")
 (princ ns)
 (princ)
)

Posted

Thanks, Marko!

I had few ideas for a routines that would include this method, and I'm happy that it was not so hard to solve.

Cheers from Bulgaria! :)

Posted

There is no need for a second selection - the list of parent entities is the 4th item in the list returned by nentselp when a nested entity is selected.

Posted

I just tried this:

Command: (nentsel)
Select object: (<Entity name: 7ff6925060b0> (58211.6 46249.8 0.0) ((1.0 0.0 0.0) (0.0 1.0 0.0) (0.0 0.0 1.0) (55462.9 46380.2 0.0)) (<Entity name: 7ff692504ec0>))

As I understand (car (nentsel)) would return the nested entity's name, and (last (nentsel)) would return parent entity, therefore when I pick the same line of the block:

Command: (entsel)
Select object: (<Entity name: 7ff692504ec0> (58178.1 46249.8 0.0))
Command: (last (nentsel))
Select object: (<Entity name: 7ff692504ec0>)

(last (nentsel)) would be equal to (car (entsel))

I hope I understood this correctly :)

Posted
(last (nentsel)) would be equal to (car (entsel))

I hope I understood this correctly :)

 

Not quite: try creating a nested block with several levels of nesting and then select a component of the block - you will find that the last item in the list returned by nentsel/nentselp will contain a list of entities, one for each parent above the selected entity.

 

In this way, (last (last (nentselp))) will be equal to (car (entsel))

Posted

Lee,

These little details make the difference why your codes are (always) flawless.

I haven't tought about multi-nested entities.

Thanks!

Posted

Thank you for your kind words Grrr, a complete knowledge of the functions comes with years of practice - you are well on your way. :thumbsup:

Posted

Hi Tharwat,

I just figured out how to use the "offline help" in AutoCAD, since I often loose internet connection.

But you've noticed again that I haven't checked it for solving this problem.

Sorry about that,

atleast someone could learn something from this thread :)

Posted

I am still keeping AutoCAD 2009 for that purpose of Help document since help docs in CADs from 2011 til 2017 are going online and that is really sucks when you have no other choice to see the rest of function in a list on the left side hand as we have them in old versions of AutoCAD prior of 2011.

Posted
I am still keeping AutoCAD 2009 for that purpose of Help document since help docs in CADs from 2011 til 2017 are going online and that is really sucks when you have no other choice to see the rest of function in a list on the left side hand as we have them in old versions of AutoCAD prior of 2011.

 

Indeed. The 2015 help I got is not that comfortable as the one you linked, still it does its purpose.

It would be very nice if that html was compiled like the acadauto.chm (AutoCad ActiveX Reference).

Posted

I have raised that issue when Autodesk has announced or posted a thread to get Developers' opinions about this matter in THIS THREAD and you can participate in the same thread if you already have account or just create one if you are interested.

 

The fore-said thread is not that old, have a look at the starting time of writing it.

Posted (edited)
I have raised that issue when Autodesk has announced or posted a thread to get Developers' opinions about this matter in THIS THREAD and you can participate in the same thread if you already have account or just create one if you are interested.

 

The fore-said thread is not that old, have a look at the starting time of writing it.

 

I just did that, I wasn't aware that using developer doc could be that comfortable as the video you posted there.

So you got kudos from me, aswell I participated in that survey.

Still I think that Autodesk should consider more the opinion from a guys like you - who often helps other users.

For example as I've read on the forums - there might be 100 skilled coders that help(ed) atleast 100 000 users.

Edited by Grrr
  • 8 years later...
Posted (edited)

Lee... Help me with this one, please...

 

I want to rotate a block using rotate3d, and i need to select it using nentsel.

Nentsel allows me selecting a polyline in the block (block has no attributes) and I need to get the selection set to that same block instance to be able to 3drotate it latter on...

Nentsel does not make the block last selected so 3drotate _p does not work by default...

 

I can get the fourth element in a list containing the entity name of the block that contains the selected object but how do I feed that into the selection for rotate3d?

Just selecting the parent block before rotate3d would allow me to use _p ...

 

 

 

Edited by ibach
Posted

If you have obtained the entity name of the block reference to be rotated, you can supply such entity name to a command selection prompt (in the same way that you might supply a selection set).

Posted (edited)

Hi, Lee...

I am dissecting a lisp that has a bug I fail to understand (hate those things;)  ...twt2.lsp

It works well until ... check the CTO.dwg, do not change view angle and try to continue applying the code on the blocks to the right.

It works flawlessly until a point when it starts rotating wrong blocks...

I even attempted to select the particular block by entity name too to be able to use rotatr3d "_P" instead "_non" but it still goes on selecting the wrong block if I do not change the view angle.

It is also interesting that the angle calculation seems to be ok, just it goes on rotating the wrong block.

Edited by ibach
Posted

You don't need to use the SELECT command - you can supply the block entity directly to the selection prompt for the ROTATE3D command.

Posted (edited)

I know, the idea was to prevent lisp rotating a wrong block, it did not help...

I did try a lot of other things too... none of them helped. No matter what I try, the program goes crazy at different view angles, rotating wrong block, or sometimes even two at once, and after it did rotate a few blocks well.

After the error happens I do undo and change a view angle and it is fine again.

I simply do not get it.

The only way to avoid the behavior is to adjust view angle every few blocks.

I even went that far to unite this lisp with an other doing just that, putting the view origin perpendicular at yx projection of the spline and 45° in Z after every selection of each block... That is the only thing that actually did the trick, but it is just the trick, does not give me the answer why it behaves as it does.

Edited by ibach

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