dhl Posted October 21, 2009 Share Posted October 21, 2009 Is it possible to use "qselect" command inside of a lisp. I can't seem to find a command line version of this one? Quote Link to comment Share on other sites More sharing options...
ronjonp Posted October 21, 2009 Share Posted October 21, 2009 ssget with a filter would be used instead of qselect. Example...this will select all circles in a drawing: (sssetfirst nil (ssget "_x" '((0 . "circle")))) Quote Link to comment Share on other sites More sharing options...
dhl Posted October 21, 2009 Author Share Posted October 21, 2009 the problem is that I cant extract the data I'm looking for through filters. Through qselect, however, I can, which is kind of strange Quote Link to comment Share on other sites More sharing options...
alanjt Posted October 21, 2009 Share Posted October 21, 2009 the problem is that I cant extract the data I'm looking for through filters. Through qselect, however, I can, which is kind of strange Well, QSelect is a little more sophisticated than the use of ssget. Could you give a little more information to this secret project? We might be able to assist. :wink: Quote Link to comment Share on other sites More sharing options...
dhl Posted October 21, 2009 Author Share Posted October 21, 2009 it's not really a secret I tried to attach a dwg file containing the objects for which I use qselect with, but there seems to be a limit on the file size? how do I attach a file? Quote Link to comment Share on other sites More sharing options...
Shawndoe Posted October 21, 2009 Share Posted October 21, 2009 Hi, What object types are you trying to select. I have not seen any selection set that could be generated by qselect that can't be done with a proper ssget filter. That's the reason there is no command line version. Basically qselect just constructs an ssget filter and executes it on everything in the drawing, or a given selection set depending on the flag. I have found that the more complex the selection set you are trying to build is, the more likely qselect is to screw up. Have a good one. Shawndoe Quote Link to comment Share on other sites More sharing options...
ronjonp Posted October 21, 2009 Share Posted October 21, 2009 Hi, What object types are you trying to select. I have not seen any selection set that could be generated by qselect that can't be done with a proper ssget filter. That's the reason there is no command line version. Basically qselect just constructs an ssget filter and executes it on everything in the drawing, or a given selection set depending on the flag. I have found that the more complex the selection set you are trying to build is, the more likely qselect is to screw up. Have a good one. Shawndoe Totally agree ... ssget with the correct filter can grab just about anything. Quote Link to comment Share on other sites More sharing options...
alanjt Posted October 21, 2009 Share Posted October 21, 2009 Hi, What object types are you trying to select. I have not seen any selection set that could be generated by qselect that can't be done with a proper ssget filter. That's the reason there is no command line version. Basically qselect just constructs an ssget filter and executes it on everything in the drawing, or a given selection set depending on the flag. I have found that the more complex the selection set you are trying to build is, the more likely qselect is to screw up. Have a good one. Shawndoe Try using ssget to filter by specific Civil 3D object properties, which do not have a dxf code. That's what I was really implying by my comment about QSelect being more sophisticated than ssget. Quote Link to comment Share on other sites More sharing options...
Shawndoe Posted October 21, 2009 Share Posted October 21, 2009 Hi, I don't have Civil 3D so I can't speak to that. You might try exporting the drawing as a DXF and see what it does with those properties. That data has to be kept someplace. Have a good one. Shawndoe Quote Link to comment Share on other sites More sharing options...
dhl Posted October 22, 2009 Author Share Posted October 22, 2009 here's a file attached with a mep device for which I can use qselect and choose according to device properties, but I cannot create a similar ssget filter. If anyone can create a ssget filter to grab using device properties such as 'name' or 'elevation' or whatever, a cyber beer is up for grabs Drawing2.dwg Quote Link to comment Share on other sites More sharing options...
dhl Posted October 22, 2009 Author Share Posted October 22, 2009 here's a file attached with a mep device for which I can use qselect and choose according to device properties, but I cannot create a similar ssget filter. If anyone can create a ssget filter to grab using device properties such as 'name' or 'elevation' or whatever, a cyber beer is up for grabs scratch 'elevation' that's dxf code 40, but 'name' is still a mystery (in this case the name is '14W') Quote Link to comment Share on other sites More sharing options...
ronjonp Posted October 22, 2009 Share Posted October 22, 2009 scratch 'elevation' that's dxf code 40, but 'name' is still a mystery (in this case the name is '14W') Well it looks like the 14W is a "AECB_DEVICE_STYLE" name. I do not have other devices with different styles to test the filter...so let me know if this works (if (setq dic (cdr (cadr (member '(3 . "AECB_DEVICE_STYLES") (entget (namedobjdict)))))) (if (setq dic (cdr (cadr (member '(3 . "14W") (entget dic))))) (if (setq ss (ssget "_x" (list (cons 0 "AECB_DEVICE")))) (vl-remove-if-not '(lambda (x) (vl-position (cons 341 dic) (entget x))) (mapcar 'cadr (ssnamex ss)) ) ) ) ) Quote Link to comment Share on other sites More sharing options...
dhl Posted October 22, 2009 Author Share Posted October 22, 2009 I don't think it works, at least I can't get it to, but I'd very much like an explanation to your code cause I can't fully follow it. I've attached another device with a different style name if you feel like trying. Drawing3.dwg Quote Link to comment Share on other sites More sharing options...
ronjonp Posted October 22, 2009 Share Posted October 22, 2009 I don't think it works, at least I can't get it to, but I'd very much like an explanation to your code cause I can't fully follow it. I've attached another device with a different style name if you feel like trying. I updated the code above...give it a try now. It should return a list of those blocks (not a ss). What questions do you have? Quote Link to comment Share on other sites More sharing options...
dhl Posted October 22, 2009 Author Share Posted October 22, 2009 I updated the code above...give it a try now. It should return a list of those blocks (not a ss). What questions do you have? It seems to work. Great job! and thanks! But I'm not quite sure of how it works, would mind terribly walking through your code step by step, line by line? How would I for instance use count the number of objects filtered,through sslength? Quote Link to comment Share on other sites More sharing options...
ronjonp Posted October 22, 2009 Share Posted October 22, 2009 It seems to work. Great job! and thanks! But I'm not quite sure of how it works, would mind terribly walking through your code step by step, line by line? How would I for instance use count the number of objects filtered,through sslength? To get the total items of a list use (length ss) instead of sslength. I found the "14W" by scouring the dxf data in AutoCAD's Vlide editor. That's how I would suggest looking deeper into these objects if necessary. Any code that contains an ename, you can perform an entget on and see more nested data. Here's a little example: Quote Link to comment Share on other sites More sharing options...
Shawndoe Posted October 22, 2009 Share Posted October 22, 2009 Hi, Sounds like somebody is owed a beer. Have a good one. Shawndoe Quote Link to comment Share on other sites More sharing options...
ronjonp Posted October 22, 2009 Share Posted October 22, 2009 Hi, Sounds like somebody is owed a beer. Have a good one. Shawndoe ...and boy am I thirsty Quote Link to comment Share on other sites More sharing options...
dhl Posted October 23, 2009 Author Share Posted October 23, 2009 ...and boy am I thirsty How does this one look? Quote Link to comment Share on other sites More sharing options...
ronjonp Posted October 23, 2009 Share Posted October 23, 2009 Delicious 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.