Jump to content

Search the Community

Showing results for tags 'dynamic blocks'.

  • 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...

  1. I 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
  2. I have the application attached below with these problems: 1. The flip action works fine on (1 to 1) but for the rest it's a mess. 2. The Length is not updating instantly I must regen. I want it to update automatically without regenerating the file Thank you Dynamic Lanes.dwg
  3. hi Lisp guru's, I have done some searches for lisps that can turn dynamic blocks into static, the one i have found incredibly done well was this Undynamic by MP http://www.theswamp.org/index.php?topic=32681.msg382548#msg382548 (defun c:UnDynamic ( / _get_item _right _make_key _dynamic->static_block _get_locked _get_dynamic_inserts _main ) (defun _get_item ( collection key / item ) (vl-catch-all-apply '(lambda ( ) (setq item (vla-item collection key))) ) item ) (defun _right ( str n / len ) (if (< n (setq len (strlen str))) (substr str (1+ (- len n))) str ) ) (defun _make_key ( collection prefix len / key ) ( (lambda ( i pad ) (while (_get_item collection (setq key (strcat prefix (_right (strcat pad (itoa (setq i (1+ i)))) len ) ) ) ) ) key ) 0 ( (lambda ( pad ) (while (< (strlen pad) len) (setq pad (strcat "0" pad)) ) pad ) "" ) ) ) (defun _dynamic->static_block ( blocks insert len ) (vla-ConvertToStaticBlock insert (_make_key blocks "STATIC_" len) ) ) (defun _get_locked ( layers / locked ) (vlax-for layer layers (if (eq :vlax-true (vla-get-lock layer)) (setq locked (cons layer locked)) ) ) locked ) (defun _get_dynamic_inserts ( blocks / inserts ) (vlax-for block blocks (vlax-for object block (if (eq "AcDbBlockReference" (vla-get-objectname object)) (if (eq :vlax-true (vla-get-isdynamicblock object)) (setq inserts (cons object inserts)) ) ) ) ) inserts ) (defun _main ( document / blocks inserts locked len ) (if (setq inserts (_get_dynamic_inserts (setq blocks (vla-get-blocks document)) ) ) (progn (foreach layer (setq locked (_get_locked (vla-get-layers document))) (vla-put-lock layer :vlax-false) ) (setq len (strlen (itoa (length inserts)))) (foreach insert inserts (_dynamic->static_block blocks insert len) ) (foreach layer locked (vla-put-lock layer :vlax-true) ) ) ) (princ) ) (_main (vla-get-activedocument (vlax-get-acad-object))) ) i am a complete noob at lisp (but trying to learn). could you guys help me somehow incorporate (strcat (vlax-get-property obj 'Name) "_DYNlocked")) into the lisp above (sorry MP for modifying) so that the replaced static blocks retain the original dynamic block name. i am hoping in future i can do a block replace on the static blocks to update them back into dynamic blocks for utilization. thanks for your help! regards, BRC
  4. I'm trying to get LISP to automate the editing of a bunch of dynamic blocks for basic things like width and depth. I want to have all these values set up by model numbers in in an Excel spreadsheet. In order to accomplish this, I've used the code for "Set Dynamic Property Value" by Lee Mac and "GetExcel" by Terry Miller (thank you both so much for getting me this far). I have succeeded in getting LISP to manipulate dynamic blocks with Lee Mac's code, but only using hard numbers. I can also get Getexcel to return numbers from my .xls. But I can't get those Excel numbers into the dynamic block values. Here's how the code I came up with looks (the part that I wrote is at the bottom and is my attempt to get all the stuff above to work together): ;------------------------------------------------------------------------------- ; Program Name: GetExcel.lsp [GetExcel R4] ; Created By: Terry Miller (Email: [email="terrycadd@yahoo.com"]terrycadd@yahoo.com[/email]) ; (URL: [url]http://web2.airmail.net/terrycad[/url]) ; Date Created: 9-20-03 ; Function: Several functions to get and put values into Excel cells. ;------------------------------------------------------------------------------- ; Revision History ; Rev By Date Description ;------------------------------------------------------------------------------- ; 1 TM 9-20-03 Initial version ; 2 TM 8-20-07 Rewrote GetExcel.lsp and added several new sub-functions ; including ColumnRow, Alpha2Number and Number2Alpha written ; by Gilles Chanteau from Marseille, France. ; 3 TM 12-1-07 Added several sub-functions written by Gilles Chanteau ; including Cell-p, Row+n, and Column+n. Also added his ; revision of the PutCell function. ; 4 GC 9-20-08 Revised the GetExcel argument MaxRange$ to accept a nil ; and get the current region from cell A1. ;------------------------------------------------------------------------------- ; Overview of Main functions ;------------------------------------------------------------------------------- ; GetExcel - Stores the values from an Excel spreadsheet into *ExcelData@ list ; Syntax: (GetExcel ExcelFile$ SheetName$ MaxRange$) ; Example: (GetExcel "C:\\Folder\\Filename.xls" "Sheet1" "L30") ; GetCell - Returns the cell value from the *ExcelData@ list ; Syntax: (GetCell Cell$) ; Example: (GetCell "H15") ; Function example of usage: ; (defun c:Get-Example () ; (GetExcel "C:\\Folder\\Filename.xls" "Sheet1" "L30");<-- Edit Filename.xls ; (GetCell "H21");Or you can just use the global *ExcelData@ list ; );defun ;------------------------------------------------------------------------------- ; OpenExcel - Opens an Excel spreadsheet ; Syntax: (OpenExcel ExcelFile$ SheetName$ Visible) ; Example: (OpenExcel "C:\\Folder\\Filename.xls" "Sheet1" nil) ; PutCell - Put values into Excel cells ; Syntax: (PutCell StartCell$ Data$) or (PutCell StartCell$ DataList@) ; Example: (PutCell "A1" (list "GP093" 58.5 17 "Base" "3'-6 1/4\"")) ; CloseExcel - Closes Excel session ; Syntax: (CloseExcel ExcelFile$) ; Example: (CloseExcel "C:\\Folder\\Filename.xls") ; Function example of usage: ; (defun c:Put-Example () ; (OpenExcel "C:\\Folder\\Filename.xls" "Sheet1" nil);<-- Edit Filename.xls ; (PutCell "A1" (list "GP093" 58.5 17 "Base" "3'-6 1/4\""));Repeat as required ; (CloseExcel "C:\\Folder\\Filename.xls");<-- Edit Filename.xls ; (princ) ; );defun ;------------------------------------------------------------------------------- ; Note: Review the conditions of each argument in the function headings ;------------------------------------------------------------------------------- ; GetExcel - Stores the values from an Excel spreadsheet into *ExcelData@ list ; Arguments: 3 ; ExcelFile$ = Path and filename ; SheetName$ = Sheet name or nil for not specified ; MaxRange$ = Maximum cell ID range to include or nil to get the current region from cell A1 ; Syntax examples: ; (GetExcel "C:\\Temp\\Temp.xls" "Sheet1" "E19") = Open C:\Temp\Temp.xls on Sheet1 and read up to cell E19 ; (GetExcel "C:\\Temp\\Temp.xls" nil "XYZ123") = Open C:\Temp\Temp.xls on current sheet and read up to cell XYZ123 ;------------------------------------------------------------------------------- (defun GetExcel (ExcelFile$ SheetName$ MaxRange$ / Column# ColumnRow@ Data@ ExcelRange^ ExcelValue ExcelValue ExcelVariant^ MaxColumn# MaxRow# Range$ Row# Worksheet) (if (= (type ExcelFile$) 'STR) (if (not (findfile ExcelFile$)) (progn (alert (strcat "Excel file " ExcelFile$ " not found.")) (exit) );progn );if (progn (alert "Excel file not specified.") (exit) );progn );if (gc) (if (setq *ExcelApp% (vlax-get-object "Excel.Application")) (progn (alert "Close all Excel spreadsheets to continue!") (vlax-release-object *ExcelApp%)(gc) );progn );if (setq ExcelFile$ (findfile ExcelFile$)) (setq *ExcelApp% (vlax-get-or-create-object "Excel.Application")) (vlax-invoke-method (vlax-get-property *ExcelApp% 'WorkBooks) 'Open ExcelFile$) (if SheetName$ (vlax-for Worksheet (vlax-get-property *ExcelApp% "Sheets") (if (= (vlax-get-property Worksheet "Name") SheetName$) (vlax-invoke-method Worksheet "Activate") );if );vlax-for );if (if MaxRange$ (progn (setq ColumnRow@ (ColumnRow MaxRange$)) (setq MaxColumn# (nth 0 ColumnRow@)) (setq MaxRow# (nth 1 ColumnRow@)) );progn (progn (setq CurRegion (vlax-get-property (vlax-get-property (vlax-get-property *ExcelApp% "ActiveSheet") "Range" "A1") "CurrentRegion") );setq (setq MaxRow# (vlax-get-property (vlax-get-property CurRegion "Rows") "Count")) (setq MaxColumn# (vlax-get-property (vlax-get-property CurRegion "Columns") "Count")) );progn );if (setq *ExcelData@ nil) (setq Row# 1) (repeat MaxRow# (setq Data@ nil) (setq Column# 1) (repeat MaxColumn# (setq Range$ (strcat (Number2Alpha Column#)(itoa Row#))) (setq ExcelRange^ (vlax-get-property *ExcelApp% "Range" Range$)) (setq ExcelVariant^ (vlax-get-property ExcelRange^ 'Value)) (setq ExcelValue (vlax-variant-value ExcelVariant^)) (setq ExcelValue (cond ((= (type ExcelValue) 'INT) (itoa ExcelValue)) ((= (type ExcelValue) 'REAL) (rtosr ExcelValue)) ((= (type ExcelValue) 'STR) (vl-string-trim " " ExcelValue)) ((/= (type ExcelValue) 'STR) "") );cond );setq (setq Data@ (append Data@ (list ExcelValue))) (setq Column# (1+ Column#)) );repeat (setq *ExcelData@ (append *ExcelData@ (list Data@))) (setq Row# (1+ Row#)) );repeat (vlax-invoke-method (vlax-get-property *ExcelApp% "ActiveWorkbook") 'Close :vlax-False) (vlax-invoke-method *ExcelApp% 'Quit) (vlax-release-object *ExcelApp%)(gc) (setq *ExcelApp% nil) *ExcelData@ );defun GetExcel ;------------------------------------------------------------------------------- ; GetCell - Returns the cell value from the *ExcelData@ list ; Arguments: 1 ; Cell$ = Cell ID ; Syntax example: (GetCell "E19") = value of cell E19 ;------------------------------------------------------------------------------- (defun GetCell (Cell$ / Column# ColumnRow@ Return Row#) (setq ColumnRow@ (ColumnRow Cell$)) (setq Column# (1- (nth 0 ColumnRow@))) (setq Row# (1- (nth 1 ColumnRow@))) (setq Return "") (if *ExcelData@ (if (and (>= (length *ExcelData@) Row#)(>= (length (nth 0 *ExcelData@)) Column#)) (setq Return (nth Column# (nth Row# *ExcelData@))) );if );if Return );defun GetCell ;------------------------------------------------------------------------------- ; OpenExcel - Opens an Excel spreadsheet ; Arguments: 3 ; ExcelFile$ = Excel filename or nil for new spreadsheet ; SheetName$ = Sheet name or nil for not specified ; Visible = t for visible or nil for hidden ; Syntax examples: ; (OpenExcel "C:\\Temp\\Temp.xls" "Sheet2" t) = Opens C:\Temp\Temp.xls on Sheet2 as visible session ; (OpenExcel "C:\\Temp\\Temp.xls" nil nil) = Opens C:\Temp\Temp.xls on current sheet as hidden session ; (OpenExcel nil "Parts List" nil) = Opens a new spreadsheet and creates a Part List sheet as hidden session ;------------------------------------------------------------------------------- (defun OpenExcel (ExcelFile$ SheetName$ Visible / Sheet$ Sheets@ Worksheet) (if (= (type ExcelFile$) 'STR) (if (findfile ExcelFile$) (setq *ExcelFile$ ExcelFile$) (progn (alert (strcat "Excel file " ExcelFile$ " not found.")) (exit) );progn );if (setq *ExcelFile$ "") );if (gc) (if (setq *ExcelApp% (vlax-get-object "Excel.Application")) (progn (alert "Close all Excel spreadsheets to continue!") (vlax-release-object *ExcelApp%)(gc) );progn );if (setq *ExcelApp% (vlax-get-or-create-object "Excel.Application")) (if ExcelFile$ (if (findfile ExcelFile$) (vlax-invoke-method (vlax-get-property *ExcelApp% 'WorkBooks) 'Open ExcelFile$) (vlax-invoke-method (vlax-get-property *ExcelApp% 'WorkBooks) 'Add) );if (vlax-invoke-method (vlax-get-property *ExcelApp% 'WorkBooks) 'Add) );if (if Visible (vla-put-visible *ExcelApp% :vlax-true) );if (if (= (type SheetName$) 'STR) (progn (vlax-for Sheet$ (vlax-get-property *ExcelApp% "Sheets") (setq Sheets@ (append Sheets@ (list (vlax-get-property Sheet$ "Name")))) );vlax-for (if (member SheetName$ Sheets@) (vlax-for Worksheet (vlax-get-property *ExcelApp% "Sheets") (if (= (vlax-get-property Worksheet "Name") SheetName$) (vlax-invoke-method Worksheet "Activate") );if );vlax-for (vlax-put-property (vlax-invoke-method (vlax-get-property *ExcelApp% "Sheets") "Add") "Name" SheetName$) );if );progn );if (princ) );defun OpenExcel ;------------------------------------------------------------------------------- ; PutCell - Put values into Excel cells ; Arguments: 2 ; StartCell$ = Starting Cell ID ; Data@ = Value or list of values ; Syntax examples: ; (PutCell "A1" "PART NUMBER") = Puts PART NUMBER in cell A1 ; (PutCell "B3" '("Dim" 7.5 "9.75")) = Starting with cell B3 put Dim, 7.5, and 9.75 across ;------------------------------------------------------------------------------- (defun PutCell (StartCell$ Data@ / Cell$ Column# ExcelRange Row#) (if (= (type Data@) 'STR) (setq Data@ (list Data@)) ) (setq ExcelRange (vlax-get-property *ExcelApp% "Cells")) (if (Cell-p StartCell$) (setq Column# (car (ColumnRow StartCell$)) Row# (cadr (ColumnRow StartCell$)) );setq (if (vl-catch-all-error-p (setq Cell$ (vl-catch-all-apply 'vlax-get-property (list (vlax-get-property *ExcelApp% "ActiveSheet") "Range" StartCell$)) );setq );vl-catch-all-error-p (alert (strcat "The cell ID \"" StartCell$ "\" is invalid.")) (setq Column# (vlax-get-property Cell$ "Column") Row# (vlax-get-property Cell$ "Row") );setq );if );if (if (and Column# Row#) (foreach Item Data@ (vlax-put-property ExcelRange "Item" Row# Column# (vl-princ-to-string Item)) (setq Column# (1+ Column#)) );foreach );if (princ) );defun PutCell ;------------------------------------------------------------------------------- ; CloseExcel - Closes Excel spreadsheet ; Arguments: 1 ; ExcelFile$ = Excel saveas filename or nil to close without saving ; Syntax examples: ; (CloseExcel "C:\\Temp\\Temp.xls") = Saveas C:\Temp\Temp.xls and close ; (CloseExcel nil) = Close without saving ;------------------------------------------------------------------------------- (defun CloseExcel (ExcelFile$ / Saveas) (if ExcelFile$ (if (= (strcase ExcelFile$) (strcase *ExcelFile$)) (if (findfile ExcelFile$) (vlax-invoke-method (vlax-get-property *ExcelApp% "ActiveWorkbook") "Save") (setq Saveas t) );if (if (findfile ExcelFile$) (progn (vl-file-delete (findfile ExcelFile$)) (setq Saveas t) );progn (setq Saveas t) );if );if );if (if Saveas (vlax-invoke-method (vlax-get-property *ExcelApp% "ActiveWorkbook") "SaveAs" ExcelFile$ -4143 "" "" :vlax-false :vlax-false nil );vlax-invoke-method );if (vlax-invoke-method (vlax-get-property *ExcelApp% "ActiveWorkbook") 'Close :vlax-False) (vlax-invoke-method *ExcelApp% 'Quit) (vlax-release-object *ExcelApp%)(gc) (setq *ExcelApp% nil *ExcelFile$ nil) (princ) );defun CloseExcel ;------------------------------------------------------------------------------- ; ColumnRow - Returns a list of the Column and Row number ; Function By: Gilles Chanteau from Marseille, France ; Arguments: 1 ; Cell$ = Cell ID ; Syntax example: (ColumnRow "ABC987") = '(731 987) ;------------------------------------------------------------------------------- (defun ColumnRow (Cell$ / Column$ Char$ Row#) (setq Column$ "") (while (< 64 (ascii (setq Char$ (strcase (substr Cell$ 1 1)))) 91) (setq Column$ (strcat Column$ Char$) Cell$ (substr Cell$ 2) );setq );while (if (and (/= Column$ "") (numberp (setq Row# (read Cell$)))) (list (Alpha2Number Column$) Row#) '(1 1);default to "A1" if there's a problem );if );defun ColumnRow ;------------------------------------------------------------------------------- ; Alpha2Number - Converts Alpha string into Number ; Function By: Gilles Chanteau from Marseille, France ; Arguments: 1 ; Str$ = String to convert ; Syntax example: (Alpha2Number "ABC") = 731 ;------------------------------------------------------------------------------- (defun Alpha2Number (Str$ / Num#) (if (= 0 (setq Num# (strlen Str$))) 0 (+ (* (- (ascii (strcase (substr Str$ 1 1))) 64) (expt 26 (1- Num#))) (Alpha2Number (substr Str$ 2)) );+ );if );defun Alpha2Number ;------------------------------------------------------------------------------- ; Number2Alpha - Converts Number into Alpha string ; Function By: Gilles Chanteau from Marseille, France ; Arguments: 1 ; Num# = Number to convert ; Syntax example: (Number2Alpha 731) = "ABC" ;------------------------------------------------------------------------------- (defun Number2Alpha (Num# / Val#) (if (< Num# 27) (chr (+ 64 Num#)) (if (= 0 (setq Val# (rem Num# 26))) (strcat (Number2Alpha (1- (/ Num# 26))) "Z") (strcat (Number2Alpha (/ Num# 26)) (chr (+ 64 Val#))) );if );if );defun Number2Alpha ;------------------------------------------------------------------------------- ; Cell-p - Evaluates if the argument Cell$ is a valid cell ID ; Function By: Gilles Chanteau from Marseille, France ; Arguments: 1 ; Cell$ = String of the cell ID to evaluate ; Syntax examples: (Cell-p "B12") = t, (Cell-p "BT") = nil ;------------------------------------------------------------------------------- (defun Cell-p (Cell$) (and (= (type Cell$) 'STR) (or (= (strcase Cell$) "A1") (not (equal (ColumnRow Cell$) '(1 1))) );or );and );defun Cell-p ;------------------------------------------------------------------------------- ; Row+n - Returns the cell ID located a number of rows from cell ; Function By: Gilles Chanteau from Marseille, France ; Arguments: 2 ; Cell$ = Starting cell ID ; Num# = Number of rows from cell ; Syntax examples: (Row+n "B12" 3) = "B15", (Row+n "B12" -3) = "B9" ;------------------------------------------------------------------------------- (defun Row+n (Cell$ Num#) (setq Cell$ (ColumnRow Cell$)) (strcat (Number2Alpha (car Cell$)) (itoa (max 1 (+ (cadr Cell$) Num#)))) );defun Row+n ;------------------------------------------------------------------------------- ; Column+n - Returns the cell ID located a number of columns from cell ; Function By: Gilles Chanteau from Marseille, France ; Arguments: 2 ; Cell$ = Starting cell ID ; Num# = Number of columns from cell ; Syntax examples: (Column+n "B12" 3) = "E12", (Column+n "B12" -1) = "A12" ;------------------------------------------------------------------------------- (defun Column+n (Cell$ Num#) (setq Cell$ (ColumnRow Cell$)) (strcat (Number2Alpha (max 1 (+ (car Cell$) Num#))) (itoa (cadr Cell$))) );defun Column+n ;------------------------------------------------------------------------------- ; rtosr - Used to change a real number into a short real number string ; stripping off all trailing 0's. ; Arguments: 1 ; RealNum~ = Real number to convert to a short string real number ; Returns: ShortReal$ the short string real number value of the real number. ;------------------------------------------------------------------------------- (defun rtosr (RealNum~ / DimZin# ShortReal$) (setq DimZin# (getvar "DIMZIN")) (setvar "DIMZIN" (setq ShortReal$ (rtos RealNum~ 2 ) (setvar "DIMZIN" DimZin#) ShortReal$ );defun rtosr ;------------------------------------------------------------------------------- (princ);End of GetExcel.lsp ;;;THIS IS THE ORIGINAL CODE PULLED FROM [url]http://www.cadtutor.net/forum/archive/index.php/t-89036.html?[/url] ;;;top half not used....just the setdynpropvalue (defun c:test ( / blk ) (if (and (setq blk (car (entsel "\nSelect dynamic block: "))) (setq blk (vlax-ename->vla-object blk)) (= "AcDbBlockReference" (vla-get-objectname blk)) (= :vlax-true (vla-get-isdynamicblock blk)) ) (LM:setdynpropvalue blk "distance1" 1.0) ) (princ) ) ;; Set Dynamic Block Property Value - Lee Mac ;; Modifies the value of a Dynamic Block property (if present) ;; blk - [vla] VLA Dynamic Block Reference object ;; prp - [str] Dynamic Block property name (case-insensitive) ;; val - [any] New value for property ;; Returns: [any] New value if successful, else nil (defun LM:setdynpropvalue ( blk prp val ) (setq prp (strcase prp)) (vl-some '(lambda ( x ) (if (= prp (strcase (vla-get-propertyname x))) (progn (vla-put-value x (vlax-make-variant val (vlax-variant-type (vla-get-value x)))) (cond (val) (t)) ) ) ) (vlax-invoke blk 'getdynamicblockproperties) ) ) (vl-load-com) (princ) ;;;;;;;;;;;; ;;;Test for plugging excel numbers into dynamic blocks (defun c:dynant () (GetExcel "C:\\Users\\eli.garcia\\Desktop\\getexceltest.xls" "Sheet1" "B5");<-- Edit Filename.xls (setq DA (GetCell "B2"));Or you can just use the global *ExcelData@ list ( / blk ) (if (and (setq blk (car (entsel "\nSelect dynamic block: "))) (setq blk (vlax-ename->vla-object blk)) (= "AcDbBlockReference" (vla-get-objectname blk)) (= :vlax-true (vla-get-isdynamicblock blk)) ) ((LM:setdynpropvalue blk "depth" DA) (LM:setdynpropvalue blk "half-width" DA)) ) (princ) ) ) I've attempted to attached a text file of all of this, but apparently that tool is broken right now, thus the huge post. I'm pretty close to being a novice at this, but I'm learning in the little time my work allows. My thought is that the way I used SETQ is wrong or that SETQ can't work with Excel like this. Please help.
  5. Hi There, This is my first post on this forum, here goes... I'm new to the concept of Dynamic Blocks, however i have a sizeable drawing estate that is built almost entirely of Dynamic blocks. The task is to replace each Dynamic block with a singular block reference, but before i get that far, i need to know what we're facing. How would i export dynamic blocks from a drawing into a directory? Each block contained within a dynamic block would need to be separated out? Is this even possible? Please help. Thanks Richard
  6. Hello, could anyone help me debug the problem? I've made a terminal block and I want to be able to rotate it and stretch it so it changes the amount of pins. Stretching seems to be in order, but not when you rotate the block - then the array items get out of place. What am I missing? Terminal_2.54.dwg
  7. 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.
  8. Hi All, im hoping one of you geniuses can help me. I have created an architectural template drawing for multiple staff to use in our company. This template drawing contains numerous different blocks for different things such as windows (plans, elevations, sections). I created this template using AutoCAD LT 2012. Every block i have created works no problem on both my computer and other colleagues computers who are running different versions of CAD wether it be full version of LT, older or newer. The only issue arises with one of my colleagues who is running AutoCAD 2012 (full) When the template is opened on his computer, the options to change linear dimentions in the properties panel does not work for some strange reason. I am stumped. If anyone can shed any light on this it would be great. Thanks Pete
  9. Hi everyone, I've learnt how to create dynamic blocks, and they're great! - within a few times of opening the drawing that is. After a while (few times of opening the dwg), the stretch action stops stretching as it should, and just moves the entire line when pulled. I then edit the dynamic block, and fix the problem by deleting the whole parameter and starting again fresh. It'll work for a while, and then the action will break again. I don't know what I'm doing wrong! I have attached a broken dynamic block for your reference... Please help me! ~ feel like I'm going crazy repeating the same steps over and over again~ DB_Section Marker_Unitless.dwg
  10. Back into the world of AutoCAD after a 20 year absence. When exporting dynamic block parameter data to Excel using the wizard, all data ends up as text (ex: 3'6 1/2") which is useless for using within Excel formulas. Is there a way around this other than changing the units to decimal before I extract the data and then converting text back to numeric in Excel?
  11. Hello guys, Is it possible to create a list in table about my dynamick blocks which is contain the different length, size and view of the blocks? Is it a command to list in table all of the blocks with this attributes? Thank you for your help! T
  12. Hello all, In the attached file there is a dynamic block, the blue box. In the lower right corner there is text showing the scale of the viewport that is inside the box. The text contains a field that will update to show the scale of the viewport automatically when the viewport scale is changed. Here's my problem, I need the text to remain at the lower right corner of the box during the stretching of the dynamic block. I've tried using dimensional constraints but this caused the dynamic block to stop working, it wont stretch. I need help please! Thanks DRBJR45 DYNAMIC BLOCK QUESTION.dwg
  13. I know this showed up in the RSS Feeds forum, but it may be of some interest to someone who may not see that. AutoCAD for Mac 2015 and AutoCAD for Mac LT 2015 were announced and released yesterday (14 Oct 2014). You can find a brief summary of the new features and additional links here.
  14. Hello, This is my first time here. I am working to create a dynamic block of a dresser, this is a simple drawing. the problem is that i want to change the worktop and the plinth with the visibility state. I have download a lisp from internet but as you can see in the drawing the worktop en plinth changed the whole time. i want to lock the chosen plinth and worktop. I hope that someone can help me. (PS. sorry for bad english)Dynamic kast.dwg
  15. My dynamic block is an Index form that has three attributes that need to be copied down as I "stretch" the block. This index needs to have anywhere between 4 and 64 entries. My knowledge of making dynamic blocks is not extensive, I have been doing it for a while, but nothing too complicated. I figured that I could get the row of attributes to "array" down with the "stretch" action. That doesn't work. Anyone have any suggestions for me?
  16. Hello Sirs! I would like to array some attributes which are inside a dynamic block. I started based on a finded file (SectionSample.dwg) but I can array only the lines without the attributes. I don't know how can I array they like in the sample dwg, how can I make the secound Lookup command. (see Drawing1.dwg) Could anybody help me? SectionSample.dwg Drawing1.dwg
  17. TheyCallMeJohn

    Lisp to Sync Attributes

    Gents, I am looking for a lisp to sync attributes. For example block Alpha has an attribute called "LOCID" and its surrounded by blocks Beta, Charlie and Delta. All four blocks have diffrent names, attributes, and paramenters but they all have "LOCID" in common. Alpha already has a value for "LOCID" but the others do not. I would like to the lisp to sync "LOCID" for all four blocks to Alpha's value by selecting all four. Also all four may not always exist together but Alpha is always there. And there are multiple groups of Alpha & friends. Does anyone have a lisp that can do this? It is way above my experience level.
  18. I'm trying to find a lisp routine that searches the current drawing for a certain string and replaces that with the string of a variable already defined by the user (in this case the text to look for is "****" and the variable is called "offerte"). Not only in the Text, Mtext but also in the Blocks, Dynamic blocks, attributes and fields... Following code gets the job done but only for normal Text and Mtext. (defun tekstreplace (/ tss tdata) (setq tss (ssget "X" (list (cons 1 "****")))) (repeat (sslength tss) (setq tdata (entget (ssname tss 0)) tdata (subst (cons 1 offerte) (assoc 1 tdata) tdata) ) (entmod tdata) (ssdel (ssname tss 0) tss) ) ) Thanx in advance for any comments!
  19. Hopefully someone can help me out there that is much more experienced. I thank you in advance for any help provided! The drawing: I have created a dynamic block (see attached below) I have two versions in the drawing, one that is setup using text, and the other using attributes. The text version is exactly how I want my dynamic block to react. In addition I'm also having a similar issue with another window block that did work correctly, not is not working correctly. Dynamic Blocks.dwg The issue: The kitchen layout, when trying to use the move actions, my attributes are not moving correctly, they are offset and move sporadically, or other attributes are moving that I don't want. Its even more wired because the bottom portion on the cabinet island works perfect, the refrigerator/range part does not work properly. The window block attribute will not rotate anymore, it used to when I first created it. I really hope someone can help me, because I'm really stumped and can't find a solution to why this is happening anywhere. I thought I understood by locking the attributes, but that's not working in this case and its very frustrating. Is there possibly a system variable that needs to be changed? Again thank you in advance for anyone that can help me. Version: 2014 LT (if anyone needs the file down saved I can do that) Solution: Window- Match orientation was previously checked when creating attribute, created new attribute, reassigned actions, attsync block. Kitchen- Attributes needed to be named differently
  20. psuengineer84

    Dynamic Block Fields

    I cannot figure out how to get a field to update to a linear parameter within a dynamic block. See attached. There is a regular dimension string on the left and my custom dynamic block on the right. Don't mind that the action parameters do not affect the field, as I will update that when I figure this thing out. Thanks! SMALL_DIM.dwg
  21. I am trying to put a horizontal constraint between two points. The distance is 124.85, but AutoCad changes it to 125 and mover the second point. Is it possible to have decimals in dimensional constraints?
  22. I made a stretch item with "Parameter Sets" or manual with "Parameters" and "Actions" and i added another action(stretch). I modified the "Distance Multiplier" to needed value. Some times it works especely with manual input version. If not works:shock: I delete the para and actions and back to the beginning. I dont understand why! I made a short example for you: test.dwg Aditional question Can I modify somehow the dyn blocks grips? When a block has many grips I need to different them! Color, shape, scale etc
  23. Hi, Wondering if someone could help me out with some code advice. I need to add new attributes into existing dynamic blocks. I know the block name I just want to automatically add attributes so the user doesn't have to do this manually for hundreds of blocks. I don't want to explode the blocks just add to them. I know AutoLISP fairly well, but I think it may be easier done in VLISP. Any help would be appriciated. Thanks, Bill
  24. Hey all, I am slowly getting the hang of writing AutoLISP and I've really appreciated everyone's input so far. I've been able to create a few lisps already that have helped out my workflow a lot! For my next lisp I am a little over my head. I'm looking to create a lisp to add the length property of my blocks together for each block name. We have a block library where we can change the length of the block and we need these lengths for a Material Take Off. Here's a breakdown of what I want the routine to be able to do: -Look for dynamic blocks in a selection -Find the lengths property for the blocks -Add the lengths together for respective blocks -Generate a report with lengths of each present block Normally I would have an attempted code for this, but I really have no idea where/how to start. Any help is most appreciated!
  25. rstadtman

    Block, Image, Extraction

    Is there a way to add an image or icon as an attribute to a block? I have created a lot of dynamic blocks and use eattext to extract data to a table for an equipment legend/table. I always have to add the legend symbol to the list manually and was wondering if there is a way to insert or link an image so that when I create the legend the symbol will automatically be loaded.
×
×
  • Create New...