- #Autocad lisp ssget modifiers how to#
- #Autocad lisp ssget modifiers archive#
- #Autocad lisp ssget modifiers code#
- #Autocad lisp ssget modifiers mac#
Today’s post assumes you’re no longer a beginner, but not an expert yet either. In part one of our series, we talked about some of the basics you should know when beginning with AutoLISP and what kinds of things you can automate with that knowledge. Architecture, Engineering and Construction.Architecture, Engineering & Construction.
#Autocad lisp ssget modifiers mac#
#Autocad lisp ssget modifiers archive#
However, if there's something you can't find, the AfraLISP Archive contains a full copy of the original site as originally created by Kenny Ramage. We're currently revamping the entire site to bring you updated tutorials and a better user experience. ‘ Hey, what's happened to AfraLISP?’ If you've visited our site before, you'll notice some big changes. Filter at the source rather than programmatically trying to filter out the undesirable entities at a later stage. Just remember that you can save yourself an awful lot of work by using selection sets with filters. Well that's about it with selection sets. (alert "\nThere are none in the DataBase") (alert (strcat "\nThere are " (itoa n) " in the DataBase")) check if there are any blocks of that name
#Autocad lisp ssget modifiers code#
construct a dotted pair - code 2 is for blocks (setq p1 (getstring "\Name of Block : ")) Here's an example of a simple routine that will count the number of blocksĬontained within a drawing : (defun c:bcount ( / p1 b a n) by using the counter index number and add it to get the name of the entity from selection set 2 get the number of items in selection set 2
#Autocad lisp ssget modifiers how to#
The following explains how to create a "Union" between 2 To delete an entity is exactly the same except for the last line : (setq sel1 (ssdel ent sel1))īut what would you do if you wanted to add two selection sets together? Three guesses what these function names are? You were right first time, (ssadd) and (ssdel). You can also Add and Delete entities from selection sets. This would create a selection set of all CIRCLES with a RADIUS (group 40) of greater or equal to 2.0.Īll of these different types of filters can be nested. This would create a selection set of all entities on Layer STEELĪs well as logical filters, you can also have relation filters : (setq sel1 (ssget '(0. To do this you use a special type of associative code, the -4. You can also use the OR logical filter, but to do this you must inform AutoLisp first. "Create a selection set of all the CIRCLES from the entities selected AND they must be on Layer "STEEL".ĪND is the default logical filter when you string associative codes Have a look at a previous example : (setq sel1 (ssget '((0. You can also use logical filters when creating selection sets. Other options available are "L" for "Last" and This will create a selection set of all "Previous" entities. You can also use other selection options with (ssget) (setq sel1 (ssget "P")) (setq p2 (getpoint p1 "\nSecond Corner: ")) Use other AutoCad functions to feed the required information to the (ssget)įunction. You cannot use prompts within the (ssget) function. Try this next : (setq sel1 (ssget "w" "\nSelect Objects by Window: ")) This example permits the user to select entities using any selection method he prefers but, will only create a selection set of CIRCLES on Layer STEEL. Would rather use a select by Window or Crossing, then just omit the If you don't want to search the entire drawing for a selection set, but The above example would create a selection set of all CIRCLES on the You can use more than one associative code if you desire : (setq sel1 (ssget "x" '((0. (Associative code 8 refers to the Layer.) This expression would create a selection set containing only entities thatĪre on the STEEL layer. For example : (setq sel1 (ssget "x" '((8. This is quite sufficient in someĬircumstances but you can filter the entities further by following the The "x" following the (ssget) is the most basic ofįilters. You can also include a selection set filter within the function. Selection method, such as Window, Crossing, Fence, etc. This function allows you to select as many entities as you like using any The AutoLisp function that enables you to do this is the (ssget) You might also want toįilter the entities so that only a certain type is within the group. Them in one place and work on them as a group. With a group, or selection set, of entities, you need to be able to place When you work with AutoCAD, you very seldom work with only one entity