![]() |
| CAD, CAM, CAE, design, technical drawing, drafting, delineation, visualization, manufacturing | ISSN 1442-2255 : 5/11/2008 - 7:45:41 AM |
|
Entity Selection In IntelliCADAny time you want to modify an entity in IntelliCAD you are required to select it. By selecting one or more entities, you are nominating which objects an IntelliCAD command should act on.Select FirstEntity selection is usually requested by any command that needs it. By default, entity selections can also be made before a modification command is initiated. The ability to create a selection and have a command act on it is controlled through settings for Entity Selection. The Pre-pick box must be checked. Check your setting through Settings > Drawing Settings... > Coordinate Input | Entity Selection.
The Pre-pick status can also be controlled with the PICKFIRST system variable. Examine the current status by entering (getvar "pickfirst"). the defaut value is 1 (On). You can change the status by typing at the keyboard or including in a LISP program (setvar "pickfirst" x) where x is 0 (zero - Off) or 1 (on). System variables are independent of drawing windows and apply across the entire IntelliCAD session. Therefore setting pickfirst off while working in one drawing window will set it off in all other drawing windows. Picking the Right SelectionHaving to select entities is one thing. Actually picking them out of the abundance of lines in a drawing is quite another. Where two entities are close together, IntelliCAD will usually pick the one most recently added to the drawing. You can improve your performance by decreasing the size of the Entity Selection pickbox - the onscreen area that IntelliCAD searches for the entity you are trying to pick. Once again this is controlled through the settings for Entity Selection... Settings > Drawing Settings... > Coordinate Input | Entity Selection. A larger pickbox size will decrease the need for you to accurately position the cursor over lines, making it easier and faster to select entities. It also makes it easier to select the wrong entity when lines are closely spaced. You can also control the pickbox size with the system variable PICKBOX. Typing (getvar "pickbox") will return the size of the current pickbox (in pixels). Use (setvar "pickbox" n) to set the size of the pickbox, where n is some integer. Selection MethodsIntelliCAD has a number of built-in selection methods that provide a range of ways that individual or multiple entities might be selected. Users familiar with AutoCAD should note that IntelliCAD has some additional methods not found in AutoCAD (rose-colored backgrounds below).
Extra Notes
More System VariablesWe looked at PICKBOX and PICKFIRST system variables above and how they could affect entity selection. There are even more system variables that impact on entity selection. Here is the full list.
You can use the regular (getvar) (setvar) functions in LISP to interrogate and set these system variables or else use the checkboxes in the Drawing Settings dialog box, Coordinate Input tab, Entity Selection option. Automating Selection with LISPThe LISP (ssget) function returns a selection set. It is further enhanced by accepting arguments that can be used to automate the inclusion of entities into a selection set. The full function syntax is(ssget [mode] [point1 [point2]] [point-list] [filter-list]). Arguments shown in square brackets are optional and LISP knows by the format of the argument supplied which argument it is. ModeThis is a string specifying the selection method (see Abbrev column in the table above). If no mode or filter list is supplied, LISP prompts to select entities. Additional to the modes listed above, mode "X" is used to create a selection set of all entities in the drawing. Point 1 and 2These arguments specify the points defining a rectangular or circular (center, radius) selection window provided in association with the mode. Point-ListA list of points defining a polygonal selection window. Filter-ListThis argument may be used with any mode and allows finer control of the selection. It is an association list similar to that returned by the entget function. The association list is discussed further in an article Entity Data List. The filter list specifies the properties to check and the values for each property to match. Group codesGroup codes of properties most commonly used in filter lists.
ExamplesIn order to use a selection set we must assign it to a symbol. This is done using setq. The ssget function returns the data that will be bound to the symbol.
Assigns a selection set to symbol A of all text entities in the drawing on layer 35TEXT. Here is another way of constructing the filter list that allows it to include variables:
Then you might use the selection set in some other automated processing...
...or in a manual action typed in the command window...
Entering the symbol name prefixed with an exclamation mark returns the symbol data to the command prompt. Efficient entity selection is an important part of being able to make rapid changes to existing drawings. Knowing the built-in options is helpful and with practice can help you use the right combination of tools to select just the entities that you want to work on. Making changes to the system variables can help you fine tune entity selection to suit your own style and the nature of your drawings and the kind of modifications you need to make. Being able to automate the selection process where appropriate will return you the best productive use of your time and help maximize your software potential. Code is provided "as-is" for purposes of instruction and utility and may be used by anyone for any purpose entirely at their own risk. It is unsupported and without warranty of any kind. No responsibility will be taken for any direct or indirect consequences resulting from or associated with the use of this code.
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| All rights reserved © 1996-2007 Digital Business Media Pty Ltd | home : editorial archive : contact : legal |