luiscarneirorm Posted July 15, 2011 Posted July 15, 2011 Hi everyone. I am developing an application for AutoCAD, and need a routines in AutoLISP, or a SCRIPTs for autocad I do the following: Select the entities that limit one or more Hatchs ... Select a different entities with the line width greater than a certain value... Thanks in advance Quote
Tharwat Posted July 15, 2011 Posted July 15, 2011 To get all hatches in a drawing . (setq htch (ssget "_x" '((0 . "HATCH")))) [/Code]And to get lines that are equal to a specific length (in my example the length is 5.0) [Code] (defun c:test (/ ss i sset e) (if (setq ss (ssget "_x" '((0 . "LINE")))) (repeat (setq i (sslength ss)) (setq sset (ssname ss (setq i (1- i)))) (setq e (entget sset)) (if (not (eq (distance (cdr (assoc 10 e)) (cdr (assoc 11 e))) 5.0) ) (ssdel sset ss) ) ) (princ) ) (sssetfirst nil ss) (princ))[/Code][b]Tharwat[/b] Quote
luiscarneirorm Posted July 15, 2011 Author Posted July 15, 2011 (edited) To get all hatches in a drawing . (setq htch (ssget "_x" '((0 . "HATCH")))) [/Code] I do not want to select the hatchs, but the lines that limit And to get lines that are equal to a specific length (in my example the length is 5.0) [Code] (defun c:test (/ ss i sset e) (if (setq ss (ssget "_x" '((0 . "LINE")))) (repeat (setq i (sslength ss)) (setq sset (ssname ss (setq i (1- i)))) (setq e (entget sset)) (if (not (eq (distance (cdr (assoc 10 e)) (cdr (assoc 11 e))) 5.0) ) (ssdel sset ss) ) ) (princ) ) (sssetfirst nil ss) (princ) )[/Code] [b]Tharwat[/b] and here the goal is to filter lines, arcs, etc., with lineweigth ([b]not lenght[/b]) greater than 0.5 for example. sorry my bad english Thanks... Edited July 15, 2011 by luiscarneirorm Quote
luiscarneirorm Posted July 15, 2011 Author Posted July 15, 2011 The marked limit is what I want to select Quote
Tharwat Posted July 15, 2011 Posted July 15, 2011 That's also not a line , it is a circle isn't it ? Quote
ketxu Posted July 15, 2011 Posted July 15, 2011 [ATTACH]28722[/ATTACH] The marked limit is what I want to select Just post ur drawing ^^ Quote
luiscarneirorm Posted July 15, 2011 Author Posted July 15, 2011 That's also not a line , it is a circle isn't it ? yes. is this hatch limit of what I want to select Quote
SLW210 Posted July 15, 2011 Posted July 15, 2011 I believe he is wanting to select the hatch BOUNDARY. He is also wanting to select all entities with a LINEWIDTH greater than a specified WIDTH. QSELECT will do both. Quote
luiscarneirorm Posted July 15, 2011 Author Posted July 15, 2011 I believe he is wanting to select the hatch BOUNDARY. He is also wanting to select all entities with a LINEWIDTH greater than a specified WIDTH. QSELECT will do both. yes, that's what I want, but this function does not allow me to do this Quote
SLW210 Posted July 15, 2011 Posted July 15, 2011 Why does Qselect not work? You must want something more. Quote
luiscarneirorm Posted July 15, 2011 Author Posted July 15, 2011 Why does Qselect not work? You must want something more. I do not find the settings for this filter with the QSELECT Quote
BlackBox Posted August 29, 2011 Posted August 29, 2011 QSELECT will select polylines with a specified *global width* Quote
luiscarneirorm Posted August 29, 2011 Author Posted August 29, 2011 My goal was to do that, but with a lisp routine, and not just for polylines, but for all types of entities. And isn't the width, but yes the lineweigth. Sorry the Inglish... Quote
SLW210 Posted August 29, 2011 Posted August 29, 2011 QSELECT will select polylines with a specified *global width* [ATTACH=CONFIG]29701[/ATTACH] You also have greater than, not equal, = equal and select all options for the operators. Quote
BlackBox Posted August 29, 2011 Posted August 29, 2011 My goal was to do that, but with a lisp routine, and not just for polylines, but for all types of entities. Sorry the Inglish... No worries; try this: (defun c:SBW ()(c:SelectByWidth)) (defun c:SelectByWidth ( / width ss) (if (and (setq width (getreal "\nEnter width: ")) (setq ss (ssget "_x" (list (cons 43 width))))) (sssetfirst nil ss) (prompt "\n** Nothing selected ** ")) (princ)) Quote
luiscarneirorm Posted August 29, 2011 Author Posted August 29, 2011 with QSELECT I can do it, but if the entity has lineweigth by layer, it is not selected Quote
BlackBox Posted August 29, 2011 Posted August 29, 2011 Wait... I just saw that you revised your post: And isn't the width, but yes the lineweigth. So you want to select by LINEWIEGHT, and not by GLOBAL WIDTH? Quote
luiscarneirorm Posted August 29, 2011 Author Posted August 29, 2011 yes, that's it. Excuse the bad English Quote
BlackBox Posted August 29, 2011 Posted August 29, 2011 Your English is good. Are the ENTITIES (the objects drawn in modelspace) assigned an individual lineweight, or are they all set to ByLayer, and the LAYER is assigned a lineweight? Quote
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.