Jump to content

Any way to select an entity knowing it's beginning and end locations?


Recommended Posts

Posted

Does anyone know that I can automatically select an entity if I already know the beginning and ending coordinates?

 

My understanding was that each time the a drawing is loaded it will/can have a different id??

 

Thanks,

 

Andrew

Posted
Does anyone know that I can automatically select an entity if I already know the beginning and ending coordinates?

 

My understanding was that each time the a drawing is loaded it will/can have a different id??

 

Thanks,

 

Andrew

(nentselp POINT)

or

(ssget "WP" POINTLIST)

or

(ssget "F" POINTLIST)

Posted
(nentselp POINT)

or

(ssget "WP" POINTLIST)

or

(ssget "F" POINTLIST)

 

Sean thanks... that's getting me really close.

 

I suppose I can filter out objects selected by accident by that method.. which is probably pretty likely.

Posted
Sean thanks... that's getting me really close.

 

I suppose I can filter out objects selected by accident by that method.. which is probably pretty likely.

 

Just use regular ssget filtering.

Who's Sean?

Posted
Just use regular ssget filtering.

Who's Sean?

 

I was replying quickly and looked at your sig and got confused ;)

Posted
I was replying quickly and looked at your sig and got confused ;)

:)

 

Did you get it sorted out?

Posted

Yes, I finally did.. I just started mucking with it today.. the only way I could get it to select the arc was to take the begin and end coords swap the x values and use a fence (so the fence would cross the arc).

 

But that worked nicely.. first time I've worked with selection sets... fun ;)

Posted

I just noticed in your original post:

 

"My understanding was that each time the a drawing is loaded it will/can have a different id??"

 

The object should always maintain the same "handle", you should be able to use that from session to session to identify/locate an object.

Posted
I just noticed in your original post:

 

"My understanding was that each time the a drawing is loaded it will/can have a different id??"

 

The object should always maintain the same "handle", you should be able to use that from session to session to identify/locate an object.

 

That would simplify life..

 

Right now I have several files that record information that I need from instance to instance.. having the handle for an object and then calculating points from there would likely be less mess..

Posted

You get the handle name from Group Code 5 of the entity data.

 

Then knowing the handle, you get the entity name from:

(handent handle)

Posted

Ok.. another quick (hopefully) question..

 

I got finding arcs down pat! But now I'm trying to select the line between 2 points (and only that line).. and I'm not having any luck... i figured the Fence would work.. I've since tried W WP..

 

Could I do what I'm doing for the arc (get begin and end point, swap either the x or y value of each pt so it's opposite) and then get the line and filter for lines with the length of the distance between the first non modified points?

 

Is there any easier way to do that?

 

Thanks for any and all input..

 

this is what my statement looks like now:

 

(setq lineSS (ssget "WP" pt_list (list (cons 0 "LINE"))))

 

Which doesn't work.. pt_list is the start end end points of the line.

Posted
Ok.. another quick (hopefully) question..

 

I got finding arcs down pat! But now I'm trying to select the line between 2 points (and only that line).. and I'm not having any luck... i figured the Fence would work.. I've since tried W WP..

 

Could I do what I'm doing for the arc (get begin and end point, swap either the x or y value of each pt so it's opposite) and then get the line and filter for lines with the length of the distance between the first non modified points?

 

Is there any easier way to do that?

 

Thanks for any and all input..

 

this is what my statement looks like now:

 

(setq lineSS (ssget "WP" pt_list (list (cons 0 "LINE"))))

 

Which doesn't work.. pt_list is the start end end points of the line.

 

Just use fence, or (ssget pnt '((0 . "LINE")))

Posted

If it works with just the one point... why didn't I try that! :)

Posted
If it works with just the one point... why didn't I try that! :)

 

Sometimes it's the simplest of things that eludes us. :)

Posted
That's not working for me for whatever reason

 

Little more vague. :wink:

 

Fence or point?

Posted

It's giving me nil when I feed it point selection with either the end or the start point. (I'm 99.9% sure the point is 100% accurate... have it stored with full accuracy)

 

Fence isn't working either

Posted

Ok, now the fence appears to be working... but now it can't find the arc.. I think I'm dealing with something other than straight logic on this one.. probably something to do with my program ;)

Posted

I changed from:

 

(setq curveSS (ssget "F" pt_list (list (cons 0 "ARC"))))

 

To:

 

(setq curveSS (ssget "F" pt_list '((0 . "ARC"))))

 

And it's happy with me now. (same change for the line selections).

 

I see that that is weird usage of the list and cons... but it was working for me that way before..

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