This makes it easy to define all of the various AutoCAD Electrical component “tag-ID” attribute tagnames in the first entry of the priority list. We decide that we’ll support wild-cards in the tag names. We first define the order for specific attribute definition tagnames. Here’s what our little AutoLISP utility’s program flow might look like in order to do this:ġ. Re-create them with (entmake…) in the desired order. With our little utility, we need to more or less duplicate what we just did above: 1. Confirm that the handles of the three new ATTDEFs now increment in the new order of TAG1, DESC1, and then RATING1. The deleted ATTDEFs are re-created, but they are now in a different order. Type these three commands at the command line:Ĥ. Now, let’s recreate them, but in a specific order. 0))Ĭommand: (setq rating1_data (entget (car (entsel)))) 0))Ĭommand: (setq desc1_data (entget (car (entsel)))) With our VXF1D.dwg drawing open on the screen, type this at the command prompt:Ĭommand: (setq tag1_data (entget(car (entsel)))) Then see if we can re-create a new, carbon-copy of the original ATTDEF with a call to “entmake”.ġ. Then delete the ATTDEF using AutoCAD ERASE command. Let’s save an ATTDEF’s block of data into an AutoLISP variable. OPTION 2: Write a little AutoLISP utility that takes an existing scrambled library symbol dwg file, deletes all the attribute definitions, and then pushes them back into the symbol’s dwg file in the desired order. OPTION 1: We could carefully re-construct our VXF1D.dwg base library symbol (and the many hundreds of others) so that the attribute defintions are each created in this order. So, if creation order is a controlling factor, we have a couple options… Then we want the three DESC1, DESC2, and DESC3 attributes listed, then all of the “RATING*” attributes, catalog assignment attributes, and then all the rest in alphabetical order. Let’s say that we really want the TAG1 attribute to be first in the list. It looks like that the creation order DOES influence the display order. Note that these three attributes are listed together with RATING1 (original handle “5E”) leading, TAG1 next (original handle “5F”) and DESC1 (original handle “60”) bring up the rear. Let’s take another look at the attribute editor dialog display when the symbol above is inserted as a block reference into a drawing. Next, the DESC1 (60) was defined and added to the symbol.ĪTTDEF creation order and attribute display orderĭoes the creation order drive the attribute’s display order when the source library symbol is inserted as a block insert into another drawing? It looks like the RATING1 attribute definition (5E) was created just before the TAG1 (5F) attribute definition. These entity handle numbers (in hexidecimal format) indicate the order that these attribute definitions were created and added to the library symbol drawing. If we repeat for the RATING1 and the DESC1 attributes, the handle numbers are “5E” and “60” respectively. This is pretty cryptic but the part shown in red is the picked entity’s “handle” number, “5F”. This expression will read the attribute definition entity (the one you select) and return the entity’s data (above). 0))Īnd then pick on the TAG1 attribute definition. Read on.)Ĭall up the block’s original “.dwg” file, VXF1D.dwg. (Note: you can use AutoCAD’s BATTMAN command and painfully re-order the attribute listing for the block reference in the active drawing… but that is a one-time fix and not a permanent library “.dwg”-based solution. It appears that the order that attributes are listed here are in the same order that the ATTDEF entities were inserted into the block’s source “.dwg” file. If I decide to use the generic attribute editor command built into AutoCAD to examine and possibly adjust values for this instance of the transformer block insert, the attribute order listed is pretty scrambled. Here is an AutoCAD Electrical transformer symbol popped into a circuit. (Note: previous postings: Lesson 001, Lesson 002, Lesson 003, Lesson 004, and Lesson 005) This lesson’s issue: Scrambled attribute order on a block insert. Experimenting with attribute definition order, entity sorting, and entmake
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |