Jump to content

Search the Community

Showing results for tags 'attributes'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • CADTutor
    • News, Announcements & FAQ
    • Feedback
  • AutoCAD
    • AutoCAD Beginners' Area
    • AutoCAD 2D Drafting, Object Properties & Interface
    • AutoCAD Drawing Management & Output
    • AutoCAD 3D Modelling & Rendering
    • AutoCAD Vertical Products
    • AutoCAD LT
    • CAD Management
    • AutoCAD Bugs, Error Messages & Quirks
    • AutoCAD General
    • AutoCAD Blogs
  • AutoCAD Customization
    • The CUI, Hatches, Linetypes, Scripts & Macros
    • AutoLISP, Visual LISP & DCL
    • .NET, ObjectARX & VBA
    • Application Beta Testing
    • Application Archive
  • Other Autodesk Products
    • Autodesk 3ds Max
    • Autodesk Revit
    • Autodesk Inventor
    • Autodesk Software General
  • Other CAD Products
    • BricsCAD
    • SketchUp
    • Rhino
    • SolidWorks
    • MicroStation
    • Design Software
    • Catch All
  • Resources
    • Tutorials & Tips'n'Tricks
    • AutoCAD Museum
    • Blocks, Images, Models & Materials
    • Useful Links
  • Community
    • Introduce Yourself
    • Showcase
    • Work In Progress
    • Jobs & Training
    • Chat
    • Competitions

Categories

  • Programs and Scripts
  • 2D AutoCAD Blocks
  • 3D AutoCAD Blocks
  • Images
    • Backgrounds

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Found 69 results

  1. How to control an attribute's visibility on a selected block? I need to turn on one of the attributes on one block only. However, ATTDISP controls visibility globally.
  2. Need a small help to modify a lisp. The lisp attached here is working, Normally command 'CN' allow me to place a "CRBLK" block with incremental number for ATT TAG "00" as i click where i wants.later when using command "FCRT" i will get all the attributes tag value and Coordinates in a individual separate Tables (As Field text). Just need some small modifications to add another Attribute in same block with value "IL=00" which i can edit later by clicking on it (attribute editor). and later when using command "FCRT", it'll also gives the output as ATT tag values then coordinates then Second ATT Tag Value individual separate Tables. The existing lisp is working good, just needs some small modification, Though its a long lisp codes and i have no idea on this.. Have attached a screenshot, DWG and Lisp file for reference.. Thanks. here is the long lisp code ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Title: Cordinates with Table ;; ;; Purpose: Numbering & create table ;; ;; Written: Bijoy Manoharan ;; ;; Command: CN, CSN, RES, CRT ;; ;; Date : Sep-2011 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Modifications: ;; ;; 1-fixed list sorting function ;; ;; 2-aded fields table command FCRT ;; ;; Written: Mahmoud Awad ;; ;; Date : Dec-2015 ;; ;; Mail :mmawad@ymail.com ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; sub function error (defun trap1 (errmsg) (setvar "attdia" ad) (setvar "attreq" aq) (setq *error* temperr) (prompt "\n Enter Command CSN for Point Sub Numbering or CRT for Table") (princ) ) ;defun (defun trap2 (errmsg) (setvar "attdia" ad) (setvar "attreq" aq) (setq *error* temperr) (prompt "\n Enter Command CN to Continue Point Numbering or CRT for Table") (princ) ) ;defun (defun trap3 (errmsg) (setq *error* temperr) (prompt "\nCoordinate Table Command Cancelled") (princ) ) ;defun ;;-----------------------------------sub function to create block ;;;--- create block function start ----- (defun crb ( ) (if (not (tblsearch "BLOCK" "CRBLK")) (progn (if (not (tblsearch "STYLE" "Isocp")) (entmake (list (cons 0 "STYLE") (cons 100 "AcDbSymbolTableRecord") (cons 100 "AcDbTextStyleTableRecord") (cons 2 "Isocp") (cons 70 0) (cons 40 2.5) (cons 3 "Isocp.ttf") ) ) ) (entmake (list (cons 0 "BLOCK") (cons 8 "0") (cons 370 0) (cons 2 "CRBLK") (cons 70 2) (cons 4 "Block to Place Coordinate Points") (list 10 0.0 0.0 0.0) ) ) (entmake (list (cons 0 "CIRCLE") (cons 8 "0") (cons 370 0) (list 10 0.0 0.0 0.0) (cons 40 1.25) ) ) (entmake (list (cons 0 "ATTDEF") (cons 8 "0") (cons 370 0) (cons 7 "Isocp") (list 10 3.0 2.5 0.0) (list 11 3.0 2.5 0.0) (cons 40 2.5) (cons 1 "00") (cons 3 "Coordinate Point") (cons 2 "00") (cons 70 0) (cons 72 0) (cons 74 2) ) ) (entmake (list (cons 0 "ENDBLK") (cons 8 "0") ) ) ;;;--- To set block units in metre 70-6 ( (lambda ( lst ) (regapp "ACAD") (entmod (append (subst (cons 70 6) (assoc 70 lst) lst) (list (list -3 (list "ACAD" (cons 1000 "DesignCenter Data") (cons 1002 "{") (cons 1070 1) (cons 1070 1) (cons 1002 "}") ) ) ) ) ) ) (entget (cdr (assoc 330 (entget (tblobjname "BLOCK" "CRBLK"))))) ) ;;;--- To make block annotative ( (lambda ( lst ) (regapp "ACAD") (regapp "AcadAnnotative") (entmod (append (subst (cons 70 1) (assoc 70 lst) lst) (list (list -3 (list "ACAD" (cons 1000 "DesignCenter Data") (cons 1002 "{") (cons 1070 1) (cons 1070 1) (cons 1002 "}") ) (list "AcadAnnotative" (cons 1000 "AnnotativeData") (cons 1002 "{") (cons 1070 1) (cons 1070 1) (cons 1002 "}") ) ) ) ) ) ) (entget (cdr (assoc 330 (entget (tblobjname "BLOCK" "CRBLK"))))) ) ) ) ;;;--- to disable allow explod----- (vl-load-com) (setq BLOCKS (vla-get-Blocks (vla-get-activedocument (vlax-get-acad-object) ) ) BLK (vla-Item BLOCKS "CRBLK") ) (vla-put-explodable (vla-Item BLOCKS "CRBLK") :vlax-false) ;;;--- end to disable allow explod----- (princ) ) ;;;--- create function block end ----- ;;------------------------main functions------- (defun c:CN(/ num num1 pt ptlist name mh-text ad aq) (command "cmdecho"0) (setq clay (getvar "clayer")) (setq ad (getvar "attdia")) (setq aq (getvar "attreq")) (setq temperr *error*) (setq *error* trap1) (setvar "attdia" 0) (setvar "attreq" 1) ;;; input text name (if (not namef) (setq namef "")) (setq name (getstring (strcat "\nEnter prefix text <" namef ">: "))) (if (= name "") (setq name namef) (setq namef name)) ;;; input number (if (not nf-ns) (setq nf-ns 1)) ; default number (setq NUM (getreal (strcat "\nEnter point number : <" (rtos nf-ns 2 0) ">: "))) (if (not num) (setq num nf-ns) (setq nf-ns num)) ; to create new layer (if (not (tblsearch "layer" "Coordinate Points")) (command "-LAYER" "N" "Coordinate Points" "C" "7" "Coordinate Points" "LT" "Continuous" "Coordinate Points""LW" "0.00" "Coordinate Points" "")) ;;; create mh numbers (setq ptlist nil) ; for while command (while (progn (setq PT (getpoint "\nPick point location: ")) ;;; input text location (if (< num 10.0) (setq num1 (strcat "0" (rtos num 2 0)))) (if (>= num 10.0) (setq num1 (rtos NUM 2 0))) (crb) ;create block (setq mh-text (strcat name num1)) ; combine text into one variable (if (not (= pt nil)) (command "CLAYER" "Coordinate Points")) ;if (if (not (= pt nil)) (command "-insert" "CRBLK" pt "1" "1" "0" mh-text)) ;if (if (not (= pt nil)) (setvar "clayer" clay)) ;if (setq by (strcat (Chr 66)(Chr 73)(Chr 74)(Chr 79)(Chr 89)(Chr 183)(Chr 86)(Chr 183)(Chr 77))) (if (not (= pt nil)) (setq num (+ num 1))) ; for increment (if (not (= pt nil)) (setq suf (- num 1))) (if (not (= pt nil)) (setq nf-ns num)) (setq ptlist (append ptlist (list pt))) ; to stop while command ) ;progn ) ;while (setvar "clayer" clay) (princ) ) ;defun (defun c:CSN(/ numf snum sf-ss mh-text pt ptlist ptx pty name ad aq) (command "cmdecho"0) (setq clay (getvar "clayer")) (setq ad (getvar "attdia")) (setq aq (getvar "attreq")) (setq temperr *error*) (setq *error* trap2) (setvar "attdia" 0) (setvar "attreq" 1) ;;; input name (if (not namef) (setq namef "")) (setq name (getstring (strcat "\nEnter prefix text <" namef ">: "))) (if (= name "") (setq name namef) (setq namef name)) ;;; input number (if (not suf) (setq suf 1)) ; default number (setq NUMF (getreal (strcat "\nEnter point number : <" (rtos suf 2 0) ">: "))) (if (not numf) (setq numf suf) (setq suf numf)) ;;; input sub number (if (not sf-ss) (setq sf-ss 1)) ; default number (setq SNUM (getreal (strcat "\nEnter point subnumber : <" (rtos sf-ss 2 0) ">: "))) (if (not snum) (setq snum sf-ss) (setq sf-ss snum)) ;;; set arial.ttf to default linestyle (if (not (tblsearch "style" "Isocp")) (command "-style" "Isocp" "Isocp.ttf" 2.5 "1" 0 "n" "n")) ; to create new layer (if (not (tblsearch "layer" "Coordinate Points")) (command "-LAYER" "N" "Coordinate Points" "C" "7" "Coordinate Points" "LT" "Continuous" "Coordinate Points""LW" "0.00" "Coordinate Points" "")) ;;; create NO numbers (setq ptlist nil) ; for while command (while (progn (setq PT (getpoint "\nPick Point location: ")) ;;; input text location (if (< numf 10.0) (setq numf1 (strcat "0" (rtos numf 2 0)))) (if (>= numf 10.0) (setq numf1 (rtos numf 2 0))) (if (< snum 10.0) (setq snum1 (strcat "0" (rtos snum 2 0)))) (if (>= snum 10.0) (setq snum1 (rtos snum 2 0))) (crb) ;create block (setq mh-text (strcat name numf1 "-" snum1)) ; combine text into one variable (if (not (= pt nil))(command "CLAYER" "Coordinate Points")) (if (not (= pt nil))(command "-insert" "CRBLK" pt "1" "1" "0" mh-text)) (if (not (= pt nil))(setvar "clayer" clay)) (if (not (= pt nil))(setq snum (+ snum 1))) ; for increment (if (not (= pt nil))(setq nf-ns (+ numf 1))) (setq ptlist (append ptlist (list pt))) ; to stop while command ) ;progn ) ;while (princ) ) ;defun (defun c:RES () (setq namef "") (prompt "\nPrefix Text Variable Reseted") (princ) ) ;defun ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;---------- sub function for Table---------- (defun CRTable () (setq LEN (length CORDS)) ;(setq CORDS (acad_strlsort CORDS)) ;;;sorts list into order (setq CORDS (vl-sort CORDS '(lambda (x1 x2) (< (atoi x1) (atoi x2))))) ;;; sorts list into order NEW (setq CNT 0) (if (= (getvar "tilemode") 1) (setvar "tilemode" 0)) (command "pspace") (setq SP (getpoint "\nPick start point for table")) (setq ht 2.5) ;; text hieght (command "-style" "Isocp" "Isocp.ttf" 2.5 "1" 0 "n" "n") (if (not (tblsearch "layer" "Coordinate Table")) (command "-LAYER" "N" "Coordinate Table" "C" "7" "Coordinate Table" "LT" "Continuous" "Coordinate Table""LW" "0.00" "Coordinate Table" "")) (if (/= SP nil) ;;;checks for null input (progn (setq TXTX (car SP)) ;;;gets x coord of text start point (setq fx txtx) ;;; set first x value (setq TXTY (cadr SP)) ;;;gets y coord (setq fy TXTY) (setq encw 25.00) ; easting & northing Column width (setq nocw 20.00) ; number Column width (setq ten (/ encw 2)) (setq tno (+ (/ nocw 2) ten)) ;; place easting & northing text (entmake (list (cons 0 "text") (cons 1 "COORDINATES") (cons 7 "Isocp") (cons 8 "Coordinate Table") (cons 10 (list (+ TXTX 2.5) (+ TXTY (/ ht 2) (* ht 2)))) (cons 11 (list (+ TXTX 2.5) (+ TXTY (/ ht 2) (* ht 2)))) (cons 40 3.0) (cons 50 0.0) (cons 72 4) ) ) (entmake (list (cons 0 "text") (cons 1 "POINTS") (cons 7 "Isocp") (cons 8 "Coordinate Table") (cons 10 (list (- TXTX tno) TXTY)) (cons 11 (list (- TXTX tno) TXTY)) (cons 40 ht) (cons 50 0.0) (cons 72 4) ) ) (entmake (list (cons 0 "text") (cons 1 "EASTING") (cons 7 "Isocp") (cons 8 "Coordinate Table") (cons 10 (list TXTX TXTY)) (cons 11 (list TXTX TXTY)) (cons 40 ht) (cons 50 0.0) (cons 72 4) ) ) (entmake (list (cons 0 "text") (cons 1 "NORTHING") (cons 7 "Isocp") (cons 8 "Coordinate Table") (cons 10 (list (+ TXTX encw) TXTY)) (cons 11 (list (+ TXTX encw) TXTY)) (cons 40 ht) (cons 50 0.0) (cons 72 4) ) ) ;; place easting & northing horizontal table lines (entmake (list (cons 0 "line") (cons 8 "Coordinate Table") (cons 10 (list (- TXTX (+ ten nocw)) (+ TXTY ht))) (cons 11 (list (+ TXTX ten encw) (+ TXTY ht))) ) ) (entmake (list (cons 0 "line") (cons 8 "Coordinate Table") (cons 10 (list (- TXTX (+ ten nocw)) (- TXTY ht))) (cons 11 (list (+ TXTX ten encw) (- TXTY ht))) ) ) (repeat LEN (setq TXTY (- TXTY (* 2 HT))) ;;;set new y coord for text (setq SP (list TXTX TXTY)) ;;;creates code start point (setq CORD (nth CNT CORDS)) ;;;gets coord from list (setq COLEN (strlen CORD)) ; (setq COM 1 GAP 1) (while (/= COLEN COM) ; (setq COM1 (substr CORD COM 1)) ;finds ',' in strings for (if (and (= COM1 ",") (= GAP 1)) (setq S1 COM GAP 2)) ;spliting string (if (and (= COM1 ",") (= GAP 2)) (setq S2 COM)) ; (setq COM (+ COM 1)) ; ) ;while (setq CODE (substr CORD 1 (- S1 1))) ;;;strips of code (setq SON (substr CORD (+ S1 1) (- S2 S1 1))) ;;;strips of north (setq SOE (substr CORD (+ S2 1) (- COLEN S2))) ;;;strips of east (entmake (list (cons 0 "text") (cons 1 code) (cons 7 "Isocp") (cons 8 "Coordinate Table") (cons 10 (list (- TXTX tno) TXTY)) (cons 11 (list (- TXTX tno) TXTY)) (cons 40 ht) (cons 50 0.0) (cons 72 4) ) ) (entmake (list (cons 0 "text") (cons 1 soe) (cons 7 "Isocp") (cons 8 "Coordinate Table") (cons 10 (list TXTX TXTY)) (cons 11 (list TXTX TXTY)) (cons 40 ht) (cons 50 0.0) (cons 72 4) ) ) (entmake (list (cons 0 "text") (cons 1 son) (cons 7 "Isocp") (cons 8 "Coordinate Table") (cons 10 (list (+ TXTX encw) TXTY)) (cons 11 (list (+ TXTX encw) TXTY)) (cons 40 ht) (cons 50 0.0) (cons 72 4) ) ) (entmake (list (cons 0 "line") (cons 8 "Coordinate Table") (cons 10 (list (- TXTX (+ ten nocw)) (- TXTY ht))) (cons 11 (list (+ TXTX ten encw) (- TXTY ht))) ) ) ;; horizontal lines (setq hl (entlast)) ; set hl as last horizontal line (setq CNT (+ CNT 1)) ) ;repeat (setq ly (caddr (assoc 10 (entget hl)))) ;set last y value ;; place easting & northing vertical table lines (entmake (list (cons 0 "line") (cons 8 "Coordinate Table") (cons 10 (list (- fx ten) (+ fy ht))) (cons 11 (list (- fx ten) ly)) ) ) (entmake (list (cons 0 "line") (cons 8 "Coordinate Table") (cons 10 (list (+ fx ten) (+ fy ht))) (cons 11 (list (+ fx ten) ly)) ) ) (entmake (list (cons 0 "LWPOLYLINE") (cons 100 "AcDbEntity") (cons 100 "AcDbPolyline") (cons 8 "Coordinate Table") (cons 90 4) (cons 70 1) (cons 10 (list (- fx (+ ten nocw)) (+ fy (* ht 4)))) (cons 10 (list (+ fx (+ ten encw)) (+ fy (* ht 4)))) (cons 10 (list (+ fx (+ ten encw)) ly)) (cons 10 (list (- fx (+ ten nocw)) ly)) ) ) ; inner rectangle (entmake (list (cons 0 "LWPOLYLINE") (cons 100 "AcDbEntity") (cons 100 "AcDbPolyline") (cons 8 "Coordinate Table") (cons 90 4) (cons 70 1) (cons 10 (list (- fx (+ ten nocw 1)) (+ fy (* ht 4) 1))) (cons 10 (list (+ fx (+ ten encw 1)) (+ fy (* ht 4) 1))) (cons 10 (list (+ fx (+ ten encw 1)) (- ly 1))) (cons 10 (list (- fx (+ ten nocw 1)) (- ly 1))) ) ) ; outer rectangle (command "erase" hl "") ) ; progn ) ;if (command "redraw") (princ) ) ; defun ;;-------------Main function to make List of points----- (defun c:CRT (/ txtx txty len cord cords cnt sp ht code son soe sox soy so1 encw nocw ten tno lat hl ly fx fy) (setvar "cmdecho" 0) (setq temperr *error*) (setq *error* trap3) (setq CORDS nil LEN nil CNT 0) ;;resets coord list to nil (princ (strcat "\n ")) (initget 1 "All Select") (setq sel (strcase (getkword "\Select individual coordinate points or Select All (S or A): "))) (if (= sel "SELECT") (setq SS (ssget '((2 . "crblk")))) (setq SS (ssget "X" '((2 . "crblk"))))) (command "UCS" "WORLD") (while (/= SS nil) ;;;checks for nil selection (setq LEN (sslength SS)) (repeat LEN (setq SO0 (ssname SS CNT)) (setq CORD (cdr (assoc '10 (entget SO0)))) ;;;gets coords of point (setq SOX (rtos (car CORD) 2 3)) ;;;strips off X coord (setq SOY (rtos (cadr CORD) 2 3)) ;;;strips off Y coord (setq SO1 (entnext SO0)) ;;;gets attribute entity (setq CODE (cdr (assoc '1 (entget SO1)))) ;;;strips off point code from attribute (setq CORD (strcat CODE "," SOY "," SOX)) ;;;creates string of code,y,x (setq CORDL (list CORD)) ;;;converts into list (if (= CORDS nil) (setq CORDS CORDL) (setq CORDS (append CORDL CORDS))) ;;;starts new list or adds to old (setq CNT (+ CNT 1)) ) (setq SS nil) ;;;finishes loop ) ;while (command "UCS" "P") (if (/= (length CORDS) 0) (CRTable)) (setq *error* temperr) (prompt "\n Coordinate Table is Placed\n © Bijoy Manoharan 2011 www.cadlispandtips.com") (princ) ) ;defun ;;------------- end Main function -------------------- ;;-------------Main function to make List of points by fields and in reail table----- (defun c:FCRT (/ e n blk corlis txtx txty len cord cords cnt sp ht code son soe sox soy so1 encw nocw ten tno lat hl ly fx fy) (setvar "cmdecho" 0) (setq temperr *error*) (setq *error* trap3) (setq CORDS nil LEN nil CNT 0) ;;resets coord list to nil (princ (strcat "\n ")) (initget 1 "All Select") (setq sel (strcase (getkword "\Select individual coordinate points or Select All (S or A): "))) (if (= sel "SELECT") (setq SS (ssget '((2 . "crblk")))) (setq SS (ssget "X" '((2 . "crblk"))))) (command "UCS" "WORLD") (if (/= SS nil) (repeat (setq n (sslength ss)) (setq blk (ssname ss (setq n (- n 1)))) (setq corlis (cons (list (cdr (assoc '1 (entget (entnext blk)))) (strcat "%<\\AcObjProp Object(%<\\_ObjId " (ObjectID (vlax-ename->vla-object (entnext blk))) ">%).TextString>%") (strcat "%<\\AcObjProp Object(%<\\_ObjId " (ObjectID (vlax-ename->vla-object blk)) ">%).InsertionPoint \\f \"" "%lu2%pt1%pr3" "\">%") (strcat "%<\\AcObjProp Object(%<\\_ObjId " (ObjectID (vlax-ename->vla-object blk)) ">%).InsertionPoint \\f \"" "%lu2%pt2%pr3" "\">%") ) corlis ) ) ) ) (if (> (setq n (length corlis)) 0) (progn ;(setq n (+ n 1)) (setq corlis (vl-sort corlis '(lambda (x1 x2) (< (if (> (atoi (car x1)) 0) (atoi (car x1)) (car x2)) (if (> (atoi (car x2)) 0) (atoi (car x2)) (car x2)))))) (initget 1) (setq pt (getpoint "\nSelect point for table: ")) (foreach li corlis (if (not e) (setq e pt) (setq e (list (+ (car e) (vla-get-width tap) 3) (cadr e) (caddr e)))) (command "-TABLE" 1 3 e) (setq tap (vlax-ename->vla-object (entlast))) (vla-SetText tap 0 0 (strcat "BEND - " (nth 1 li))) (vla-SetText tap 2 0 (strcat "E=" (nth 2 li))) (vla-SetText tap 3 0 (strcat "N=" (nth 3 li))) ) ) ) (command "UCS" "P") (setq *error* temperr) (prompt "\n Coordinate Table is Placed") (princ) ) ;defun (defun ObjectID ( obj ) (eval (list 'defun 'ObjectID '( obj ) (if (and (vl-string-search "64" (getenv "PROCESSOR_ARCHITECTURE")) (vlax-method-applicable-p (vla-get-utility (acdoc)) 'getobjectidstring) ) (list 'vla-getobjectidstring (vla-get-utility (acdoc)) 'obj ':vlax-false) '(itoa (vla-get-objectid obj)) ) ) ) (ObjectID obj) ) (defun acdoc nil (eval (list 'defun 'acdoc 'nil (vla-get-activedocument (vlax-get-acad-object)))) (acdoc) ) ;;------------- end Main function -------------------- ATT Cordinates IN Table - CN,FCRT.LSP Drawing - Copy111.dwg
  3. My condition: I use AutoCAD to do Fire Alarm plans for a client. One of the redundant things I have to do is label a device on a floor plan with the same label as the same device on a riser diagram on a layout sheet. I construct my riser after laying the devices out on the floor plan. My problem is I have to do the label twice which takes a ton of time. Once on the floor plan and the same label for that device on the riser diagram. Possible solution: 1. Go through Label the block attribute once on floor plans. The labels are sequential once inputted. 2. Extract those attributes 3. Import those attributes into the blocks on the riser diagram...but individually. I want to be able to select the block and import the data in a one-to-one ratio in sequence as I go through selecting the corresponding block on the riser diagram. Basically after I've exported the data I want, I want to import the data on a block by block basis. I want to click a block and import a string a data, the next block i select takes the next string of data in the list sequentially and so on. Does something like that exist? Is that possible? Forever grateful.
  4. Dear all, Need some help. I have more than 200 Blocks contains Attributes, basically its a legend sheet, all the blocks have attribute texts but in different several layers, i need to bring it to one layer. say i have one light fitting with an attribute text called A1, the block and the attribute text colour are in different layer- both are bylayer. out side block has layer-1 inside block the light fittings has layer-0 (this is bcoz all the lights have same colour) the attribute text has layer-2 (this is because the colour is white so kept it another layer) i have another light fitting with an attribute text called A2, the block and the attribute text colour are in different layer- both are bylayer. out side block has layer-1 inside block the light fittings has layer-0 (this is bcoz all the lights have same colour) the attribute text has layer-3 (this is because the colour is white so kept it another layer) now i want to change both the attribute text layer to layer-4 at once like this i have more than 200 blocks. hoping a glad response/help/advice/solution from all the Gurus here. Thanks lonelysn
  5. GIB39

    Blocks and multiple visibility

    Hi I'm getting back into cad and starting to develop some dynamic blocks. Can anyone give me some tips on how to do multiple visibility parameters in LT possibly using look ups. Should I be using blocks within blocks if that makes sense?. Does anyone have any ideas for creating electrical distribution boards using dynamic blocks with attributes. Your help would be much appreciated. Thanks.
  6. Hi All, I'm very new to these so please be nice! Basically our company cuts heaps of metal panels. We draw each panel, do the cutting lists, nest and optimise them on sheets manually. I'm trying to save some time by creating a block that'll make life a bit easier. So I've currently got a block where you can input the height and width & it automatically adjusts. What I'd like to add is an atrribute? or a tag? where that little box pops up and you can input the height & width in there instead. Additionally I'd like the pop up box to include the panel # which is then shown on the panel (see drawing where I've just added in 'a1', 'a2' etc). Next step would be to include a table that collates the information from all the panels (we often do around 30 panels per order). Currently we manually input all the sizes in to excel. Just to make things more interesting we use metric autocad but are often given dimensions in imperial, so half the time is spent manually converting feet & inches into mm and then drawing the panels in mm. If there's any way to input in imperial and show both metric and imperial on the dimension line that would just be the best thing ever! I might be being a bit greedy with so many requests so if anyone could help with just one of the above it would be very much appreciated. Thankyou trial.dwg
  7. I am using AutoCAD 2006 and I created a dynamic block that has 4 attributes and 2 visibility states. Two of the attributes are visible in one state, while the other two are invisible. After toggling the visibility states, the two invisible attributes become visible, and the two visible attributes become invisible. When I insert the block, or when I use the Attribute Edit command, I only can access the attributes that are visible. The invisible-state attributes do not show up. I would like to enter all attribute infomation at one time, and then turn on/off the visibility as needed. Question: Can all of the visible and invisible attributes be inputed/edited at one time without having to change the visiblity states? Thank you for any help. Ray
  8. So Im getting a "too few Arguments" error message and after debugging I still cant seem to find which line is causing this error. The function of this lisp is supposed to select a register bock [attached below]: create a list for each block selected based on the cfm values in its [cfm] attribute. if the value falls within a certain range then it should've selected the property sort value. any help would be much appreciated. 10 X 8 Supply Register Sets.dwg
  9. Hi First time poster here. I've only got AutoCAD13 and there's almost no chance for us to get civil 3d. But I have a 4km pipeline i'm trying to model so I'll need a longsection. Besides doing it manually is there a more efficient method, given the contour file I have is at 0.5m intervals. I'm thinking even a script in Excel that pulls the intersect for the pipeline polyline and contour lines and return the x-y-z coordinates. Thanks
  10. I have done quite a search and have not found any good explanation to use entmake to insert a defined block, and scale or rotate that block upon insertion. The idea is to tag a line (pipe), and add the diameter, length, and cut-length of that pipe using attributes. I have the code to get the line information ready, and was working on the entmake for the attribute block to label the "pipes". Here is the code for the attribute block: (defun c:apd (/ LAY1 LAY2 LAY3 LAY4 CLR1 CLR2 CLR3 CLR4 LTP1 LTP2 LTP3 LTP4 FONT value1 value2 value3 rotation p) ;;; Change layer names and colors to suit user. (setq LAY1 "S-Pipe-Detail" LAY2 "S-Pipe-Dia" LAY3 "S-Pipe-Length" LAY4 "S-Pipe-Cut" CLR1 1 CLR2 2 CLR3 3 CLR4 4 LTP1 "Continuous" LTP2 "Continuous" LTP3 "Continuous" LTP4 "Continuous" FONT "Standard" ) ;;;======================== Block Definition ====================== (defun DEF_PipeDetail () ;generated using EntMaker CAB 04- MakeEntmake.lsp (entmake '((0 . "BLOCK") (100 . "AcDbEntity") (67 . 0) (8 . "0") (100 . "AcDbBlockReference") (66 . 1) (2 . "PipeDetail") (10 0.0 0.0 0.0) (70 . 2) ) ) (entmake '((0 . "ATTDEF") (100 . "AcDbEntity") (67 . 0) (8 . "S-Pipe-Dia") (100 . "AcDbText") (10 0.0 0.0 0.0) (40 . 0.095833333333331) (1 . "-DIA-") (50 . 0.0) (41 . 0. (51 . 0.0) (7 . "Standard") (71 . 0) (72 . 1) (100 . "AcDbAttributeDefinition") (280 . 0) (3 . "PIPE DIAMETER:") (2 . "DIA") (70 . 0) (74 . 1) (280 . 0) ) ) (entmake '((0 . "ATTDEF") (100 . "AcDbEntity") (67 . 0) (8 . "S-Pipe-Length") (100 . "AcDbText") (10 0.0 0.0 0.0) (40 . 0.095833333333331) (1 . "-LENGTH-") (50 . 0.0) (41 . 0. (51 . 0.0) (7 . "Standard") (71 . 0) (72 . 1) (100 . "AcDbAttributeDefinition") (280 . 0) (3 . "PIPE LENGTH:") (2 . "PIPELENGTH") (70 . 0) (74 . 3) (280 . 0) ) ) (entmake '((0 . "ATTDEF") (100 . "AcDbEntity") (67 . 0) (8 . "S-Pipe-Cut") (100 . "AcDbText") (10 0.0 0.0 0.0) (40 . 0.095833333333331) (1 . "-LENGTH-") (50 . 0.0) (41 . 0. (51 . 0.0) (7 . "Standard") (71 . 0) (72 . 1) (100 . "AcDbAttributeDefinition") (280 . 0) (3 . "CUT LENGTH:") (2 . "CUTLENGTH") (70 . 0) (74 . 3) (280 . 0) ) ) (entmake '((0 . "ENDBLK") (100 . "AcDbBlockEnd") (8 . "0"))) (princ) ) ; end DEF_PipeDetail ;;;======================== Insert Block ====================== (defun insert_PipeDetail (p lay rot d_lay pl_lay cl_lay font value1 value2 value3) (entmake (list (cons 0 "INSERT") (cons 2 "PipeDetail") (cons 10 p) (cons 8 lay) (cons 66 1) (cons 62 256) (cons 39 0) (cons 6 "BYLAYER") (cons 50 rot);block rotation (radians) ) ) (entmake (list (cons 0 "ATTRIB") (cons 8 d_lay) (cons 10 (mapcar '* (mapcar '+ p '(0.0 0.046875 0.0)) (list (getvar "textsize")(getvar "textsize")(getvar "textsize")))) (cons 11 (mapcar '+ p '(0.0 0.140625 0.0))) (cons 40 (getvar "textsize"));text height (cons 1 Value1) (cons 2 "DIA") (cons 70 0);attr flag (cons 50 0);text rot (cons 41 1);relative x-factor, width ;;; (cons 51 0);oblique angle (default 0) (cons 7 font) ;;; (cons 71 0);text flag (def 0, bkwrd 2, upside dn 4) (cons 74 1);1 BCenter (cons 72 1);1 Center (cons 210 (list 0 0 1));extrusion (def 0,0,1) ;;; (cons 73 0) (cons 62 256);color (bylayer 256) ;;; (cons 39 0);thickness (def 0) (cons 6 "BYLAYER") ) ) (entmake (list (cons 0 "ATTRIB") (cons 8 pl_lay) (cons 10 (mapcar '* (mapcar '+ p '(-0.046875 -0.140625 0.0)) (list (getvar "textsize")(getvar "textsize")(getvar "textsize")))) (cons 11 (mapcar '+ p '(-0.046875 -0.140625 0.0))) (cons 40 (getvar "textsize"));text height (cons 1 Value2) (cons 2 "PIPELENGTH") (cons 70 0);attr flag (cons 50 0);text rot (cons 41 1);relative x-factor, width ;;; (cons 51 0);oblique angle (default 0) (cons 7 font) ;;; (cons 71 0);text flag (def 0, bkwrd 2, upside dn 4) (cons 74 3);3 TCenter (cons 72 1);1 Center (cons 210 (list 0 0 1));extrusion (def 0,0,1) ;;; (cons 73 0) (cons 62 256);color (bylayer 256) ;;; (cons 39 0);thickness (def 0) (cons 6 "BYLAYER");linetype name ) ) (entmake (list (cons 0 "ATTRIB") (cons 8 cl_lay) (cons 10 (mapcar '* (mapcar '+ p '(0.046875 -0.28125 0.0)) (list (getvar "textsize")(getvar "textsize")(getvar "textsize")))) (cons 11 (mapcar '+ p '(0.046875 -0.28125 0.0))) (cons 40 (getvar "textsize"));text height (cons 1 Value3) (cons 2 "CUTLENGTH") (cons 70 0);attr flag (cons 50 0);text rot (cons 41 1);relative x-factor, width ;;; (cons 51 0);oblique angle (default 0) (cons 7 font) ;;; (cons 71 0);text flag (def 0, bkwrd 2, upside dn 4) (cons 74 3);3 TCenter (cons 72 1);1 Center (cons 210 (list 0 0 1));extrusion (def 0,0,1) ;;; (cons 73 0) (cons 62 256);color (bylayer 256) ;;; (cons 39 0);thickness (def 0) (cons 6 "BYLAYER");linetype name ) ) (entmake (list (cons 0 "SEQEND") (cons 8 lay) ) ) ) ;;;======================== Make Layers ====================== (defun make_layer (MyLayer MyColor MyLtype) (entmake (list (cons 0 "LAYER") (cons 100 "AcDbSymbolTableRecord") (cons 100 "AcDbLayerTableRecord") (cons 2 MyLayer) (cons 6 MyLtype) (cons 62 MyColor) (cons 70 0) ) ) ) ;;;======================== Main Function ======================= (if (not (tblsearch "layer" LAY1)) (make_layer LAY1 CLR1 LTP1) ) (if (not (tblsearch "layer" LAY2)) (make_layer LAY2 CLR2 LTP2) ) (if (not (tblsearch "layer" LAY3)) (make_layer LAY3 CLR3 LTP3) ) (if (not (tblsearch "layer" LAY4)) (make_layer LAY4 CLR4 LTP4) ) (if (not (tblsearch "block" "PipeDetail")) (DEF_PipeDetail) ) ;;; temporary setq (setq value1 "MyDiameter" value2 "MyLength" value3 "MyCut" rotation 1.5708 ) ;;; end temporary setq (setvar "osmode" 512) (while (setq p (getpoint "\nPick insertion point >> ")) (insert_PipeDetail p LAY1 rotation LAY2 LAY3 LAY4 FONT value1 value2 value3) ) ;;;end while (princ) ) This code works, but I cannot get the lower two attributes to offset from the line (by half the text height), nor can I get the entire block to rotate (I used rotation 1.5708, or 90 degrees). If anyone can enlighten me, or kick me in the right direction it would be much appreciated. Thanks, CHL
  11. Hey guys, So, is it possible to have a lisp that automatically labels a block based on an attribute? Ideally, it would also be a field so that if the attribute changed, the mulitleader text would as well. For example, let's say I have a dynamic block for an Oak Tree, which has three sizes: 2", 3", & 4". It'd be great if I could run a LISP that would create a multileader that read " 2"-Oak Tree ". It'd be doubly great if the 2" part of that was a field that updated if the dynamic block was changed to its 4" state. For reference, this wonderful Lee Mac LISP is what I currently use for my labeling and it's brilliant. Ideally, I'll end up combining the attribute/field labeling component with this lisp somehow. Lastly, I'm not great at all with writing LISPs, but I'd like to figure out how this one would work so that I can modify it as need be on my own. Thanks for any help!
  12. Hi All, Following an idea posed in this thread, I have created the following code to enable a user to automatically update titleblock attributes using data sourced from a CSV Drawing Register, a file which may be created using the DataExtraction command. The code is designed to be as generic as possible to benefit the majority of users. The location of the CSV Drawing Register may be entered at the top of the code, or this may be left nil (current setting), in which case the user is prompted for selection of a CSV Drawing Register from which attribute data will be sourced. The code also comes equipped with an optional block filter, located at the top of the code. If nil, the code will update all attributed blocks with attribute tags matching those listed in the headings of the CSV Drawing Register. The block filter may also use wildcards: e.g. "*BORDER". An example of the expected format of the CSV Drawing Register is as follows: +------------+-----------+----------+----------+-----+----------+ | DWG | Layout* | TAG1 | TAG2 | ... | TAGN | +------------+-----------+----------+----------+-----+----------+ | Drawing1 | Layout1 | Value1 | Value2 | ... | ValueN | +------------+-----------+----------+----------+-----+----------+ | Drawing1 | Layout2 | Value1 | Value2 | ... | ValueN | +------------+-----------+----------+----------+-----+----------+ | Drawing2 | Layout1 | Value1 | Value2 | ... | ValueN | +------------+-----------+----------+----------+-----+----------+ | ... | ... | ... | ... | ... | ... | +------------+-----------+----------+----------+-----+----------+ *Layout column is optional. Where the first column contains drawing filenames (with or without extension). The second column is an optional 'Layout' column for drawings containing different titleblock information on different layouts. Change the setting at the top of the code if the CSV Drawing Register contains a Layout column next to the Drawing Filename Column. The remaining columns contain the corresponding values of those attribute tags listed in the first row. A Short Demonstration The code is currently geared to run upon being loaded to enable users to add the code to either the Startup Suite or ACADDOC.lsp (see here for information about doing so), and hence automatically update titleblock attribute information whenever a drawing file is opened. This 'autorun' functionality can easily be disabled as described in the code header. Please read the code header for more information, and, if you have any questions about the code, please don't hesitate to ask. Regards, Lee A full description of the program including example CSV Drawing Register demonstrating the correct format can be found here. UpdateTitleblockV1-9.lsp
  13. I am trying to link the actual value of the length property of a polyline with a custom property I've created in a dynamic block. Basically, I would like to be able to link the property line length with a call out block that contains the line's length as "Count" property (Dbl). I've created a custom property to hold the numeric value (i believe this should be a Double value in order to sum values in table?) so I can then sum all lengths of similar call out blocks in a table. The reason I am using a custom property is so I can specify it as a Double value so the values will be able to sum up in the table. Using fields, I can link the poly line length to an attribute field but this becomes a string object which I can't add together in the table, as far as I understand anyway. What changes would I need to make to Lee Mac's awesome Lisp routines (huge fan of yours, Lee) to add this feature? I've attached the lisp file with the sub routines that seem useful for this task included, but I have quite a bit of trouble putting it all together. I've reverted all of Lee's subroutines back to the original code so none of my customization causes any errors. My end game is simple: Select the poly line(s), select the dynamic block to be associated with said line(s), and then populate the custom "Count" property with the length of the selected poly line(s) as a Double value. This will allow me to summarize the total length using data extraction and a table. Any help with this would be greatly appreciated, and please include the why & how if you have the time so I can learn and share with others You guys are the best, thanks in advance! Count.lsp PROP_CO_1.dwg
  14. Hi all, I have been tasked with coming up with a dynamic block that is for a chute. It is a simple rectangle that I've added some attributes to and a field within one of the attributes. What I need the formula to do is calculate the angle of the chute based on user input for the upper height and the lower height (rise) and "Distance 1" (run) and then return the answer in the field. It returns the correct angle on insertion, however, when I change any of the values and Regen the result is incorrect. In addition, I would like the "Angle" attribute to not show in the dialog box when inserted. Is that possible? Thanks. Chute plan view.dwg
  15. Hi - New to auto cad & need help I'll explain as best i can. Version:AutoCAD Mechanical 2012. I have a number of CAD blocks i need to change an attribute in each of the blocks multiple times. The attribute DEVNAME - Varies* over multiple blocks. I need to change the number used in the attributes eg: Block 1 attribute DEVNAME = RR1 Block 2 attribute DEVNAME = LR1 Block 2 attribute DEVNAME = AR1 I would like to change the 1 in all the attributes to a 2 without having to manually change each attribute name individually. The result I'm after would be: Block 1 attribute DEVNAME = RR2 Block 2 attribute DEVNAME = LR2 Block 2 attribute DEVNAME = AR2 I have hundreds to change hopefully there is an easy way. Thanks in advance any help i receive.
  16. I'm trying to see if this is possible. Drawing with many dynamic blocks, all with many attributes. Was curious if there was a routine that would select a single block - enable user to fill in the attributes click OK - then move onto the "next" block in the drawing until complete. Anything like this remotely possible?
  17. Hi, i am no autolisper, and i am having trouble to adapt this excellent lisp made by Tharwat to my use... My problem is with the attributes upon insertion, after the command, no attribute appear on the drawing. I will not post my attempts on doing so, (for they are really messy...) but the original code and the description of what i inttend to do. My block has 3 attribs, ID, KM and M. ID must be prompted by user upon inserction; KM must be taken from the lwspline length (variable l), i.e.: if swpline is 350120,00 m long, then KM is 350, if swpline is 120,00m long, then KM is 000; M must be treated the same way as KM, but in 350120,00, M is 120 and so on... The text output format on the drawing is "km 350+120" Test.lsp [ATTACH]58954[/ATTACH]
  18. I've been trying to find existing lisp routines to do the following for a while now (off and on). While I have found some that will change values of Attributes or the text width for every piece of text in a drawing, that is not what I need done. I need a lisp routine that will be manually modified with the current Attribute TAG and Block name based on client titleblock. It can't require manual selection (user input) as this will be used in a script to batch run the lisp routine. To kind of summarize, I would like the ability to specify a block name and attribute tag name (in the specified block) and be able to set the text width factor in the drawing to account for longer filenames per client requests. This is only for the 1 attribute in all drawings. Any help will be greatly appreciated. Here is an example: Titleblock has: Attribute: File name TAG: DRAWINGNO Value: Linked to actual filename with a field Current text width factor is .8 and it needs to be .7 to fit within the titleblock space.
  19. Hi all, I'm trying to edit attributes in a block - about a hundred of them. I'm using ATTSYNC, but when I choose the block, the error"the selected block has no attributes". I look in the properties window and it lists it as a "block reference". I've tried BEDIT, but when I click it - no attributes show. So, I'm curious if this "block" was created in some different fashion? Weird, that this has not come up before. Many thx
  20. Hi there, I have many different blocks with different attributes and custom properties (rotation angle, position 1 X, position 1 Y, and so on). All of them have a perfect correspondence between attributes names and custom properties names. For example, if i have a block with custom properties "rotation_head" and "position_head" i will have two attributes called "rotation_head" and "position_head". I'd need a lisp with two functions cycling through all the selected different blocks; one of the function would: - for each selected block, read the attributes and set the custom properties while the other would: - for each selected block, read the custom properties and set the attributes. Do you think something like this would be possible? The reason behind this kind of request is because i need to import and export shapefiles to autocad map and i need to set blocks custom properties using shapefiles table.a Thanks in advance for any ideas/tips Regards GTK
  21. I work with AutoCad Electrical. I've been using an amazing Lisp file by Alan J. Thompson (who is a frequent contributor) call Match Attributes Values and it has been a enormous time saver. However, with AutoCad Electrical, the electrical blocks called "components" have an attribute called Tag1 that gives the component its uniqueness. It is this (and only this) attribute that I DON'T want to change when I copy all attributes between these blocks. I attached the wonderful MAV code. (I hopes that's okay.) Can someone help me in modifying the code that would change all attributes except one labelled "TAG1". (and maybe one or two others possible additional tags--for future.) Thank you for any help. mav.lsp
  22. I'm trying to develop a dynamic block that takes two attributes input from the user (lets call them "x" and "y") and then divides them by the distance ("dist") of a line within the block that may be stretched. Then the result of this formula ((x + y) / dist) is to be displayed as an M-TEXT within the block definition. The problem I'm experiencing is that no matter what I do I can't convey the value of the attributes to the M-TEXT within the block - It only shows their default values and there's nothing I can do to update it with the current attribute values for the block. In other words: Lets say my default values for "x" and "y" are "0" and "1", respectively. I then change the value of "x" to "10" and "y" to "20" on the instance of the block. My M-TEXT has a field in it that references a "formula", and the formula references object->value for both the x and y attributes: "x + y" as the formula. However instead of showing me "30", the block instead shows "1" as these were my default values. I've attached the file I'm working with as an example (although the fields are named differently than what's here). I've posted the question to AutoDesk's forums as well using a more true example of what I'm doing (I simplified it here because it's been difficult to explain what the problem is), so if you would like to read my other attempt at explaining the problem, check out: http://forums.autodesk.com/t5/autocad-2013-2014-2015-2016/value-of-attribute-doesn-t-show-up-when-used-within-formula/td-p/5878314 WIP.dwg
  23. I'm trying to modify Title Block Attributes values using -attedit without being prompted for old value of the attribute. The only way I was able to make it work is as shown below if I specify old value (100). I'm trying to write an external script (.scr) which will be specified upon draftsight.exe startup, open the drawing, modify title block attributes, save and exit without human interaction. The script does not know the old value, that's why i'm trying to avoid it. I'm using draftsight. : -EDITBLOCKATTRIBUTE Default: Yes Confirm: Edit block attributes one at a time? Specify Yes or No» n Performing global editing of block attribute values. Default: Yes Confirm: Edit only attributes currently visible? Specify Yes or No» n Default: * Options: * to select all blocks or Specify block(s)» MY_TTL_BLK5 Default: * Options: * to select all attributes or Specify attribute name(s)» DRAWINGNO Default: * Options: * to select all attribute values or Specify attribute value» 100 1 block attributes selected. Specify old text string» 100 Specify new text string» 101 Thank you.
  24. I have been working on a lisp program that will change one or multiple attributes on one or more blocks. I would however like to be able to add the current attribute values to the .dcl program, however I cannot manage to get attribute values for more than one block at a time. For example if you had two identical blocks with two separate attribute values (values not tags) and you pick both at the same time, when you open your properties window it will list the identical values (if any) and list the different values as "varies". Is there any way I can get this exact thing in autolisp? I am using vanilla lisp not visual, any help would be appreciated.
  25. Okay guys so here is what I am looking for, I want to write a lisp or modify an existing lisp, that will select blocks within a given selection frame and summarize the attribute data in table either in the drawing or an excel file. I found LeeMac's awesome program "Count Attribute Values" but my issues is that for right now its still way over my head so I am having difficulties following much of it. Also I would like to limit it to blocks with a certain name(s) and then within that block only summarize one specific attribute because the blocks have a count attributes which isn't necessary. If anyone can give me some guidance or something I can build off of it would be greatly appreciated. Also I know EATTEXT can do this but I am looking for something substantially quicker.
×
×
  • Create New...