CAD Panacea. Ok, getting back to the last (ssget) call in part 1..(ssget . Then we are passing it two points (5,5 and 8,8). Then we are telling it to only accept circle entities. The last two pieces tell it to only accept circles whose radius (DXF code 4. Webopedia's list of Data File Formats and File Extensions makes it easy to look through thousands of extensions and file formats to find what you need. With literally thousands of data file formats employed by Windows and.So in summary, this bit of code will search the entire database and return only circles whose radius is less than 1. The - 4 group code is a special code that lets you perform relational testing. There are codes for equal, not equal, less than, less than or equal, greater than, greater than or equal, and two bitwise operators. This type of filtering works great for locating entities on a certain layer, or that have a certain color or linetype. The code above will select all entity types on the TEMP layer whose color is green (3). New and/or enhanced functions New and/or enhanced functions and some bug fixes. New file format 'AutoCAD 2010' and is likely to be used for AutoCAD 2011 and AutoCAD 2012. Last file format change was in AutoCAD 2007.
Be careful when filtering for color, linetype and lineweight. These filters only apply if the particular property is explicitly set. In the example above, if the color of all entities on the TEMP layer is set to BYLAYER, the selection set will be empty, even if the color of layer TEMP is green (3). You can use wildcard matching in selection set filtering also.(ssget . For example, a dimension whose dimstyle is DIM5. DIM3. 9 will be selected. Dimensions with a dimstyle of DIM4. T, DIM7. 77, DIMKK, or DIM are not selected. Other wildcard syntax can be found under the (wcmatch) function in the Autolisp Reference Guide. You may have figured it out by now, but . In other words, in the above example, it's going to find entities that have the type dimension AND whose dimension style is DIM##. There may be cases were you want to specify . It creates a selection set out of CIRCLE entities that have a radius of exactly 1. LINE entities on the ABC layer. If you did not use the . Let's look at one more example.(ssget '((0 . Last, but not least.. The code above uses a . In this case, DXF code 7. POLYLINE and/or LWPOLYLINE. The goal here is to create a selection set of closed polylines. If DXF code 7. 0 has the . However, we cannot simply filter for DXF code 7. If LTGEN is turned on and it's a closed polyline, then DXF code 7. This is why you must use the . There is much more information in the Autolisp Developer's Guide on advanced selection set handling. Good luck and post some of your examples in the comments section if you want. Labels: Auto. CAD, Programming, Tips. Perma. Link. Posted 8/2. PM. Exploring the autolisp SSGET function - part 1. If you have written routines with Autolisp, then you have probably used the (ssget) function to select entities on the screen, either automatically or by prompting the user.(ssget) is a powerful function that can do more than you probably realize. Let's look at a simple example.(ssget '((0 . This is the same as above, except now any entity type that ends in TEXT is added to the selection set. At first, this looks like a good way to select TEXT and MTEXT, and it is. However, you have to be careful because this will also select RTEXT entities, and if your code is not equipped to deal with RTEXT, it may fail.(ssget '((0 . But what if you don't want to bother the user to select entities, you just want to select ALL the MTEXT and TEXT entities in the drawing?(ssget . This tells the (ssget) function to evaluate every entity in the drawing and then the filtering mechanism will filter out everything except MTEXT and TEXT. Entities on frozen layers are included when using the . The CP is for crossing polygon. The power of (ssget) comes from the incredibly fast filtering that it performs. Can you imagine having to evaluate an entire database of entities and manually filter out all the circles whose radius is less than 1. Example below.(ssget . More details on this code and other examples in part 2. Labels: Auto. CAD, Programming, Tips. Perma. Link. Posted 8/2. AM. S: :STARTUP Function. In the previous post about Startup Lisp Functions, the special (S: :STARTUP) function was mentioned. Startup lisp code is loaded before the drawing is initialized, but you cannot call the (COMMAND) function until after the drawing is initialized. The solution is to place your (COMMAND) calls inside the (S: :STARTUP) function. For example, if you want to reset the scale list and purge out regapps each time a drawing is opened, you could use something like this: (defun- q mystartup ()(command . Because this function can be defined in other places, it is best to append to it rather than overwrite it. Use (defun- q) to create a function defined as a list, so it can be appended. To finish the example from the previous post.. But it is nothing more than a plain lisp file, except that the first one found at drawing startup (just put it in your support file search path), is loaded automatically each time a drawing is opened. Why use this approach instead of the ? Ease of migration for one thing. When you upgrade from your current version of Auto. CAD to the next version, simple add the path of your . More details about this can be found here in a earlier article. The second reason is that if you have more than one Auto. CAD install to manage, using a networked copy of . Each drawing has it's own lisp environment so it's necessary to load your startup lisp routines using . Be careful when including lisp code because the (command) function should not be called until after Auto. CAD initializes. You can do this safely by using the (s: :startup) function. More on that next time. Here is a sample . In this example, the TXT file contains coordinates, and the code will draw either points or lines. One thing to keep in mind. Most times when you open a file for read or write, you should open the file, perform the entire operation, then close the file. Keep the code to a minimum while the file is open. This way if you run into an unhandled error, the file isn't stuck open, and in the case of shared files, you are not locking the file for an extended amount if time. Here is a sample of the TXT file we are reading with the code. It contains X and Y values, separated by commas. Here is the code. Keep in mind that this code was left in a simple form to help show the steps involved. It is not optimized and there is no error checking and/or restoring of changed sysvars. These are topics for a different tutorial.(defun c: foo ( / fn fp lst l); ; Prompt the user to select a . TXT file.(setq fn (getfiled . More details in the link below. Press Release. Labels: Linetypes, News, Notices. Perma. Link. Posted 7/0. AM. Quick access to layer states manager. Starting with Auto. CAD 2. 00. 8, you now have direct access to the Layer States Manager, without opening the LAYER dialog first. In Auto. CAD 2. 00. LAYERS toolbar. In Auto. CAD 2. 00. 9, click the button shown below: Once you get the Layer States Manager dialog open, don't forget to click the button to expand the dialog and reveal more options. Labels: Auto. CAD, Auto. CAD 2. 00. 8, Auto. CAD 2. 00. 9, Tips. Perma. Link. Posted 7/0. AM. Land Desktop Service Pack Level. In certain situations, you can install SP2 for Land Desktop 2. SP2 is installed, but in fact it is not really installed. I have confirmed this with Autodesk support. However, the exact circumstances regarding how this occurred has not been determined. So how can you check to see if SP2 has really been applied? According to Autodesk support, you can test for SP2 by looking at the version of this file: C: \Program Files\Auto. CAD Civil 3. D Land Desktop Companion 2. Aecc. Aln. Svr. Loader. I do not know if the same rules apply for plain Land Desktop, but I suspect it would be the same. Labels: Land Desktop, Tips. Perma. Link. Posted 6/0. D2. 0 Modern - Apocalypse. Get the full title to continue reading from where you left off, or restart the preview.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
November 2017
Categories |