Jump to content

NEntSelP not working if point not in view?!


chavlji

Recommended Posts

I use NEntSelP to convert current selection to SubEnts.

So for all sel. sets that were picked by mouse clicks i use:

(setq EName (NEntSelP "" PT))

where PT is point of mouse click transformed to World coordinates.

 

It works if all points are visible. As soon as user pans the viewport, so that one or more point is not on the visible screen anymore, NEntSelP returns nil! Why? How to correct it?

Link to comment
Share on other sites

Probably won't solve your issue, but I believe nentselp takes points in UCS :thumbsup:
He's having issues with trying to select an object at a point that's outside of the current view.
Link to comment
Share on other sites

(if (and (setq pt (getpoint))
        (setq ss (ssget pt)))
 (setq eName (ssname ss 0)))

Won't work if point is outside of view and the return isn't nested (assuming the OP wants that).
Link to comment
Share on other sites

I just want to convert Selection Set that I get with (SSGet "_I") - selection set that existed before my function was executed - into subentities instead of main entities. I convert only those elements that were selcted by single picks. And pick is point.

I solved by:

 

(if (not (InsideRect PT ScreenRect )) (AbsMoveView pt)))

(setq NSS (nentselp "" PT))

 

Clumsy and unreliable (if zoom changed pickbox might miss everything), but I don't think it can be done any other way...

Any suggestions are greatly accepted :)

Link to comment
Share on other sites

Zoom extents and zoom previous.

Use vla instead of command because it will ignore if the viewport is locked and sense you are going to set the zoom back to its previous state, who cares.

Link to comment
Share on other sites

You can have multiple objects selected in one SS with multiple picks. Between picks user can zoom in/out. You can't know at what zoom each pick was made...

So zooming to previous state wouldn't do. You don't know at wich state certain pick was made.

Link to comment
Share on other sites

You can have multiple objects selected in one SS with multiple picks. Between picks user can zoom in/out. You can't know at what zoom each pick was made...

So zooming to previous state wouldn't do. You don't know at wich state certain pick was made.

Make your selections and add them to a selection set. Based on the given information (not much), it's the only option. When you only have a point select with, you can't select what you can't see.

 

IMO, it sounds like there could be a better way to approach your overall goal.

Agreed. Granted, it would be a lot easier to help one reach that goal if they were a little more liberal with the information.:roll:

Link to comment
Share on other sites

Widely what is my goal:

 

User often selects some objects and THEN executes certain command that is supposed to do something with that objects.

We all agree that it is very annoying if function asks user to select objects, if they have already been selected before he has run function.

 

And what if program is supposed to do something with subentities instead of main entities?

 

I need a function that can determine wich subentites are already selected (implied selection)....

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