Joro-- 发表于 2022-7-6 22:43:28

VBA - Getting an entity at a o

I'm trying in VBA to allow the user to select a line at a specific point. Something like getPoint (with the osnap visible) but in fact getting both - the coordinates of the point of selection and the selected object. It should be almost like using the GetEntity, but there I can't control visibly the point of selection.
 
Any ideas?

AstroNout 发表于 2022-7-6 23:01:09

I think you'll first have to select the line, and then select the point. That's the easy way out :-)

Joro-- 发表于 2022-7-6 23:10:22

I know I can do it this way, but I'd still like to perform the operation with one selection only...

AstroNout 发表于 2022-7-6 23:22:51

Well, then I haven't got a better ideaSorry!

BIGAL 发表于 2022-7-6 23:29:55

entsel gives entity and pick point but!! pick point is not necessarily on actual object but can be real close. in lsp VBA ?

Joro-- 发表于 2022-7-6 23:35:41

It's VBA. I kind of managed to pick an object at osnap point using GetPoint, where osnap works, and then iterate trough all the objects to find which of them can be picked at this point. I'd like there was a better solution but it turs out that this works quite fasteven in case of several thousands of objects

BIGAL 发表于 2022-7-6 23:46:42

Another way if you can pick the object using snaps then retrieve the variable lastpoint then select object at this point ?
页: [1]
查看完整版本: VBA - Getting an entity at a o