Search the Community
Showing results for tags 'numbering'.
Found 9 results
custom attribute numbering lisp
jetxcc posted a topic in AutoLISP, Visual LISP & DCL
Quickly numbering (Numinc) with text frames in different colors
mickeforsberg posted a topic in AutoLISP, Visual LISP & DCLHello! >> Can't change profile settings at the moment, but I'm using AutoCAD 2018 I'm looking for some tips and suggestions on how to go about this... As per new fire alarm drawing regulations it's required for the drawings to look something like this: And the devices are usually incrementally numbered from 1.001-1.100; 2.001-2.100 etc. (not shown in the example image). The addresses should have a text frame with a darker shade of the hatch color, as shown. I have tried this: For the addresses I used a layer with object color Red, to make the frame Red for example. Then I manually selected the text and in the Text editor I changed the text to Black. This kinda works, but is tedious to do this manually with hundreds of addresses, and when using Numinc the text color changes to Red automatically. I could perhaps use another layer for just the frame and background mask, but as far as I know it can't automatically change size depending on the text content, which would be great. Otherwise I'd have to resize every frame to make it look proper. Does anyone have any suggestion on how to make these two work together? Or perhaps a different approach all together? Thanks, and have a nice weekend!
Numbering equipment with text LSP
ryankevin15 posted a topic in AutoLISP, Visual LISP & DCLHello, Does anyone know of a LSP out there that will number the selection below properly without editing each piece of text?
Prefix and number increment autolisp
aawilds posted a topic in AutoLISP, Visual LISP & DCLHello, I am looking for a lisp that will allow me to increment an attribute in a block from one block to the next by doing a window selection. The lisp that I have now that I got from Chaitanya Chikkala (see below) works great, but I have to select each block individually. With 2000+ blocks it is easy to make a mistake. When I window select with it, it numbers them as they were added to the drawing. This does not work for me because multiple people work on drawings and then are combined into a master drawing so the order is wrong. Is there a way for a direction to be added, even if it is just along the x or y axis? Or is there a lisp that already does this? Any help is very much appreciated. (defun c:incr (/ ent obj x i ST_STR) (command "._undo" "_be") (SETQ ST_STR1 (GETSTRING "\nENTER STARTING NUMBER OF THE SEQUENCE(ANY ALPHABET/WORD)")) (SETQ ST_STR (GETSTRING "\nENTER STARTING NUMBER OF THE SEQUENCE(ANY INTEGER)")) (vl-load-com) (setq i 0) (prompt "\nSelect blocks one at a time and in order") (SETQ BLOCK_LIST (SSGET)) (SETQ BLOCK_LIST (FORM_SSSET BLOCK_LIST)) (while (< I (LENGTH BLOCK_LIST)) (SETQ ST_STR (STRCAT "" ST_STR)) (SETQ TEMP_ELE (NTH 0 (ATTRIBUTE_EXTRACT (NTH I BLOCK_LIST)))) (SETQ TEMP_ATTRIBUTE (STRCAT ST_STR1 ST_STR)) (SETQ TEMP_TAG (NTH 0 TEMP_ELE)) (MODIFY_ATTRIBUTES (NTH I BLOCK_LIST) (LIST TEMP_TAG) (LIST TEMP_ATTRIBUTE)) (SETQ ST_STR (ITOA (+ (ATOI ST_STR) 1))) (setq i (+ i 1)) ) (command "._undo" "_e") (princ)) (DEFUN FORM_SSSET (SSSET / I TEMP_ELE LIST1) (SETQ I 0) (SETQ TEMP_ELE NIL) (SETQ LIST1 NIL_) (WHILE (< I (SSLENGTH SSSET)) (SETQ TEMP_ELE (SSNAME SSSET I)) (SETQ LIST1 (CONS TEMP_ELE LIST1)) (SETQ I (+ I 1)) ) (REVERSE LIST1) ) (DEFUN ATTRIBUTE_EXTRACT (ENTNAME / ENT_OBJECT SAFEARRAY_SET I LIST1) (SETQ SAFEARRAY_SET NIL) (SETQ ENT_OBJECT ENTNAME) (SETQ ENT_OBJECT (VLAX-ENAME->VLA-OBJECT ENT_OBJECT)) (IF (= (VLAX-GET-PROPERTY ENT_OBJECT "HASATTRIBUTES") :VLAX-TRUE) (PROGN (SETQ SAFEARRAY_SET (VLAX-SAFEARRAY->LIST (VLAX-VARIANT-VALUE (VLAX-INVOKE-METHOD ENT_OBJECT "GETATTRIBUTES") ) ) ) (SETQ I 0) (SETQ LIST1 NIL) (WHILE (< I (LENGTH SAFEARRAY_SET)) (SETQ LIST1 (CONS (LIST (VLAX-GET-PROPERTY (NTH I SAFEARRAY_SET) "TAGSTRING") (VLAX-GET-PROPERTY (NTH I SAFEARRAY_SET) "TEXTSTRING") ) LIST1 ) ) (SETQ I (+ I 1)) ) (SETQ LIST1 (REVERSE LIST1)) (SETQ LIST1 (SORT_FUN LIST1 0 0))) (SETQ LIST1 NIL) )LIST1 ) (DEFUN MODIFY_ATTRIBUTES (ENTNAME IDENTIFIER VALUE / TEMP_ELE ENT_OBJECT SAFEARRAY_SET I J) (SETQ SAFEARRAY_SET NIL) (SETQ ENT_OBJECT ENTNAME) (SETQ ENT_OBJECT (VLAX-ENAME->VLA-OBJECT ENT_OBJECT)) (IF (= (VLAX-GET-PROPERTY ENT_OBJECT "HASATTRIBUTES") :VLAX-TRUE) (PROGN (SETQ SAFEARRAY_SET (VLAX-SAFEARRAY->LIST (VLAX-VARIANT-VALUE (VLAX-INVOKE-METHOD ENT_OBJECT "GETATTRIBUTES") ) ) ) (SETQ I 0) (SETQ J 0) (SETQ LIST1 NIL) (WHILE (< I (LENGTH SAFEARRAY_SET)) (SETQ TEMP_ELE (VLAX-GET-PROPERTY (NTH I SAFEARRAY_SET) "TAGSTRING")) (IF (/= (VL-POSITION TEMP_ELE IDENTIFIER) NIL) (PROGN (VLAX-PUT-PROPERTY (NTH I SAFEARRAY_SET) "TEXTSTRING" (NTH (VL-POSITION TEMP_ELE IDENTIFIER) VALUE)) )) (SETQ I (+ I 1)) ) ))) (DEFUN SORT_FUN (LIST1 FLAG1 FLAG2 /) (IF (= NIL (VL-CONSP (CAR LIST1))) (PROGN (SETQ LIST1 (INDEX_ADD LIST1)) (SETQ LIST1 (VL-SORT LIST1 '(LAMBDA (X Y) (< (CADR X) (CADR Y))) ) ) (SETQ LIST1 (MAPCAR '(LAMBDA (X) (CADR X)) LIST1)) ) (PROGN (IF (NOT (ATOM (NTH FLAG1 (NTH 0 LIST1)))) (SETQ LIST1 (VL-SORT LIST1 '(LAMBDA (X Y) (< (NTH FLAG2 (NTH FLAG1 X)) (NTH FLAG2 (NTH FLAG1 Y))) ) ) ) (PROGN (SETQ LIST1 (VL-SORT LIST1 '(LAMBDA (X Y) (< (NTH FLAG2 X) (NTH FLAG2 Y))) ) ) ) ) ) ) LIST1 )
LISP for creating text label (numbering) of the sheet of cadastral map
shercer posted a topic in AutoLISP, Visual LISP & DCLHello all, I am new to AutoLISP, and I have an assignment to make a lisp which would calculate and write number of the sheet of cadastral map (which is defined by scale and coordinates). I'd like the sheet scale in which the number is calculated to be 1:1000 (more advanced option - to be able to choose). Numbering is defined on this link : http://listovi.dgu.hr/vezaizmedjupodjela.html (I'm from Croatia) Any help would be great, thanks.
Array Number/Count Dynamic Block
Ranime posted a topic in AutoCAD Drawing Management & OutputI have the following block where I have successfully inserted stretch action (no limits) and array action (limit 20). I need to display the array count number next to the block so that I don't have to count the aisles every time I have to use the action. Dynamic Array Count.dwg
Dynamic block Array numbering
amosweing posted a topic in AutoCAD Drawing Management & Outputhi i"m trying to create a dynamic plan-staircase with step numbers, the stairs are added by an array command and i could count the total number of stairs by dividing the total distance by width of step. stair2.dwg but i want a number on each step ! (using autocad 2014)
Help With LT05 Macro Autonumber and OS Near
Chumbawamba posted a topic in The CUI, Hatches, Linetypes, Scripts & MacrosI have this macro (from Somewhere) to increment numbers on each click. I would like it to set to object snap Near before i click so it will just snap the number to the nearest thing i click. *^C^C_text;\;$M=$(+,$(getvar,USERI1),1);setvar;USERI1;$M=$(+,$(getvar,USERI1),1); Also is there anyway to change this so the text is rotated 90deg? As a separate macro. Any help greatly appreciated. Thanks in Advance.
.LSP File for Auto-Numbering?
diggity0169 posted a topic in AutoLISP, Visual LISP & DCLHello everyone, I'm new to the forum. At work here, we're creating thousands of parcels based on information from a county. For each city block, we have to enter a consecutive block number, and then each parcel has its own number. I was wondering if anyone knows of a lisp file that would work for this, where you could click in the box or something and it would number it starting with #1, then #2, etc.. on the current layer and text? Currently, I have to copy the text, move it over, double click, type 2, and repeat about 50,000 times.