Jump to content

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


Hudson

Recommended Posts

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

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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 ;)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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")))

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 ;)

Link to comment
Share on other sites

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

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