kalai Posted May 15, 2012 Share Posted May 15, 2012 Hi , SelectAtpoint doesnot work. Can anyone point out mistake Dim tpt1(0 To 2) As Double ftype(0) = 0 fdata(0) = "LINE" ftype(1) = -4 fdata(1) = "<OR" ftype(2) = 8 fdata(2) = "LAYER1" ftype(3) = 8 fdata(3) = "LAYER2" ftype(4) = -4 fdata(4) = "OR>" qset.SelectAtPoint tpt1, ftype, fdata No object is selected. Quote Link to comment Share on other sites More sharing options...
MSasu Posted May 15, 2012 Share Posted May 15, 2012 I don’t have now access to an AutoCAD with VBA, and has been a while since I didn’t used it. So, until someone with experience on this will see this thread, I will do some guessing: Is the selection set object properly declared and registered? Have you tried that selection without filters? Is the point used for selection visible on screen? Can this issue be related with size of pick box related to current zoom level? Quote Link to comment Share on other sites More sharing options...
kalai Posted May 15, 2012 Author Share Posted May 15, 2012 i tried without filter , object seelcted is not of layer "Layer1" or "layer2" Increase of pickbox doenot work out. declaration: dim qset as acadselectionset set qset=thisdrawing.selectionsets.add("qsetname") Quote Link to comment Share on other sites More sharing options...
Joro-- Posted May 16, 2012 Share Posted May 16, 2012 kalai, I don't know where is the problem in your code, but I wrote a few lines and there seems to be no problem. I'm posting my code, hope it will help you Sub TrySelectAtPoint() On Error Resume Next Dim ss As AcadSelectionSet ThisDrawing.SelectionSets("MySS").Delete If Err Then Err.Clear End If ThisDrawing.SelectionSets.Add "MySS" Set ss = ThisDrawing.SelectionSets("MySS") Dim selPt(2) As Double selPt(0) = 0 selPt(1) = 0 selPt(2) = 0 MsgBox ss.Count & " BEFORE selecting" ss.SelectAtPoint selPt MsgBox ss.Count & " AFTER selecting" Line.sel End Sub Quote Link to comment Share on other sites More sharing options...
kalai Posted May 17, 2012 Author Share Posted May 17, 2012 thanks for your reply, but only one object is selected by this(selectatPoint) method. Quote Link to comment Share on other sites More sharing options...
Joro-- Posted May 17, 2012 Share Posted May 17, 2012 yes - only one object is selected because it's just a basic example to show you that this functionality works. If you perform .SelectAtPoint several times with different poitsmore objects will be added to the selectionset. For two points: Sub TrySelectAtPoint() On Error Resume Next Dim ss As AcadSelectionSet ThisDrawing.SelectionSets("MySS").Delete If Err Then Err.Clear End If ThisDrawing.SelectionSets.Add "MySS" Set ss = ThisDrawing.SelectionSets("MySS") Dim selPt(2) As Double selPt(0) = 0 selPt(1) = 0 selPt(2) = 0 MsgBox ss.Count & " BEFORE selecting" ss.SelectAtPoint selPt selPt(0) = 100 selPt(1) = 0 selPt(2) = 0 ss.SelectAtPoint selPt MsgBox ss.Count & " AFTER selecting" End Sub Quote Link to comment Share on other sites More sharing options...
irneb Posted May 18, 2012 Share Posted May 18, 2012 thanks for your reply, but only one object is selected by this(selectatPoint) method. Isn't that what SelectAtPoint is supposed to do? It's as if the user selected by picking on an entity, even if there are 1000's of entities crossing that point only the top-most in the draw-order will be selected. If you want all the entities inside the pickbox area of a particular point, you'd need to calculate the pickbox dimensions relevant to the current zoom factor and then use Select with the acSelectionSetCrossing mode and the calculated rectangle of the "pickbox". Quote Link to comment Share on other sites More sharing options...
MSasu Posted May 18, 2012 Share Posted May 18, 2012 i tried without filter , object seelcted is not of layer "Layer1" or "layer2" Seems to me that OP's issues is the fact that defined filter doesn't work as expected. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.