Jump to content

Search the Community

Showing results for tags 'block'.

  • 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. Hello Guys, I have a doubt, someone knows if has some Lisp to get the last digits (specified - user input) of a dwg file name (in Windows explorer) and write it on a specific attribute name on a internal block. Eg.: I have a folder with 600 pages dwg files, so, the last numbers of it is a specific item to show the page number of that file, it's possible read these numbers and write in an attribute inside dwg to correct the page index.
  2. All, I've been using Lee Mac's "Add object to block" lisp for sometime now and it works great, and one of the things I use it for is my title block for revisions but now the revision block has been inserted into the title block as a block and it won't add what I want to the revision block. Is there a way to make it find the revision block inside of the title block? Basically I would to able to pick the block inside of a block. ;;----------------=={ Add Objects to Block }==----------------;; ;; ;; ;; Adds all objects in the provided SelectionSet to the ;; ;; definition of the specified block. ;; ;;------------------------------------------------------------;; ;; Author: Lee Mac, Copyright © 2011 - [url="http://www.lee-mac.com"]www.lee-mac.com[/url] ;; ;;------------------------------------------------------------;; ;; Arguments: ;; ;; doc - Document Object in which block resides. ;; ;; block - Entity name of reference insert ;; ;; ss - SelectionSet of objects to add to definition ;; ;;------------------------------------------------------------;; (defun LM:AddObjectstoBlock ( doc block ss / lst mat ) (setq lst (LM:ss->vla ss) mat (LM:Ref->Def block) mat (vlax-tmatrix (append (mapcar 'append (car mat) (mapcar 'list (cadr mat))) '((0. 0. 0. 1.)))) ) (foreach obj lst (vla-transformby obj mat)) (vla-CopyObjects doc (LM:SafearrayVariant vlax-vbobject lst) (vla-item (vla-get-Blocks doc) (cdr (assoc 2 (entget block)))) ) (foreach obj lst (vla-delete obj)) (vla-regen doc acAllViewports) ) ;;-----------------=={ Remove From Block }==------------------;; ;; ;; ;; Removes an Entity from a Block Definition ;; ;;------------------------------------------------------------;; ;; Author: Lee Mac, Copyright © 2011 - [url="http://www.lee-mac.com"]www.lee-mac.com[/url] ;; ;;------------------------------------------------------------;; ;; Arguments: ;; ;; ent - Entity name of Object to Delete from Block [ENAME] ;; ;;------------------------------------------------------------;; (defun LM:RemovefromBlock ( doc ent ) (vla-delete (vlax-ename->vla-object ent)) (vla-regen doc acAllViewports) (princ) ) ;;------------------=={ Safearray Variant }==-----------------;; ;; ;; ;; Creates a populated Safearray Variant of a specified ;; ;; data type ;; ;;------------------------------------------------------------;; ;; Author: Lee Mac, Copyright © 2011 - [url="http://www.lee-mac.com"]www.lee-mac.com[/url] ;; ;;------------------------------------------------------------;; ;; Arguments: ;; ;; datatype - variant type enum (eg vlax-vbDouble) ;; ;; data - list of static type data ;; ;;------------------------------------------------------------;; ;; Returns: VLA Variant Object of type specified ;; ;;------------------------------------------------------------;; (defun LM:SafearrayVariant ( datatype data ) (vlax-make-variant (vlax-safearray-fill (vlax-make-safearray datatype (cons 0 (1- (length data)))) data ) ) ) ;;------------=={ SelectionSet -> VLA Objects }==-------------;; ;; ;; ;; Converts a SelectionSet to a list of VLA Objects ;; ;;------------------------------------------------------------;; ;; Author: Lee Mac, Copyright © 2011 - [url="http://www.lee-mac.com"]www.lee-mac.com[/url] ;; ;;------------------------------------------------------------;; ;; Arguments: ;; ;; ss - Valid SelectionSet (Pickset) ;; ;;------------------------------------------------------------;; ;; Returns: List of VLA Objects, else nil ;; ;;------------------------------------------------------------;; (defun LM:ss->vla ( ss / i l ) (if ss (repeat (setq i (sslength ss)) (setq l (cons (vlax-ename->vla-object (ssname ss (setq i (1- i)))) l)) ) ) ) ;;---------------=={ Block Ref -> Block Def }==---------------;; ;; ;; ;; Returns the Transformation Matrix and Translation Vector ;; ;; for transforming Block Reference Geometry to the Block ;; ;; Definiton. ;; ;;------------------------------------------------------------;; ;; Author: Lee Mac, Copyright © 2011 - [url="http://www.lee-mac.com"]www.lee-mac.com[/url] ;; ;;------------------------------------------------------------;; ;; Arguments: ;; ;; e - Block Reference Entity ;; ;;------------------------------------------------------------;; ;; Returns: List of 3x3 Transformation Matrix, Vector ;; ;;------------------------------------------------------------;; (defun LM:Ref->Def ( e / _dxf a l n ) (defun _dxf ( x l ) (cdr (assoc x l))) (setq l (entget e) a (- (_dxf 50 l)) n (_dxf 210 l)) ( (lambda ( m ) (list m (mapcar '- (_dxf 10 (tblsearch "BLOCK" (_dxf 2 l))) (mxv m (trans (_dxf 10 l) n 0) ) ) ) ) (mxm (list (list (/ 1. (_dxf 41 l)) 0. 0.) (list 0. (/ 1. (_dxf 42 l)) 0.) (list 0. 0. (/ 1. (_dxf 43 l))) ) (mxm (list (list (cos a) (sin (- a)) 0.) (list (sin a) (cos a) 0.) (list 0. 0. 1.) ) (mapcar '(lambda ( e ) (trans e n 0 t)) '( (1. 0. 0.) (0. 1. 0.) (0. 0. 1.) ) ) ) ) ) ) ;; Matrix x Vector - Vladimir Nesterovsky (defun mxv ( m v ) (mapcar '(lambda ( r ) (apply '+ (mapcar '* r v))) m) ) ;; Matrix x Matrix - Vladimir Nesterovsky (defun mxm ( m q ) (mapcar (function (lambda ( r ) (mxv (trp q) r))) m) ) ;; Matrix Transpose - Doug Wilson (defun trp ( m ) (apply 'mapcar (cons 'list m)) ) ;;---------------------=={ Select if }==----------------------;; ;; ;; ;; Provides continuous selection prompts until either a ;; ;; predicate function is validated or a keyword is supplied. ;; ;;------------------------------------------------------------;; ;; Author: Lee Mac, Copyright © 2011 - [url="http://www.lee-mac.com"]www.lee-mac.com[/url] ;; ;;------------------------------------------------------------;; ;; Arguments: ;; ;; msg - prompt string ;; ;; pred - optional predicate function [selection list arg] ;; ;; func - selection function to invoke ;; ;; keyw - optional initget argument list ;; ;;------------------------------------------------------------;; ;; Returns: Entity selection list, keyword, or nil ;; ;;------------------------------------------------------------;; (defun LM:SelectIf ( msg pred func keyw / sel ) (setq pred (eval pred)) (while (progn (setvar 'ERRNO 0) (if keyw (apply 'initget keyw)) (setq sel (func msg)) (cond ( (= 7 (getvar 'ERRNO)) (princ "\nMissed, Try again.") ) ( (eq 'STR (type sel)) nil ) ( (vl-consp sel) (if (and pred (not (pred sel))) (princ "\nInvalid Object Selected.") ) ) ) ) ) sel ) ;-------------------------------------------------------------; ; -- Test Functions -- ; ;-------------------------------------------------------------; (defun c:Add2Block ( / *error* _StartUndo _EndUndo acdoc ss e ) (defun *error* ( msg ) (if acdoc (_EndUndo acdoc)) (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*") (princ (strcat "\n** Error: " msg " **"))) (princ) ) (defun _StartUndo ( doc ) (_EndUndo doc) (vla-StartUndoMark doc) ) (defun _EndUndo ( doc ) (if (= 8 (logand 8 (getvar 'UNDOCTL))) (vla-EndUndoMark doc) ) ) (setq acdoc (vla-get-ActiveDocument (vlax-get-acad-object))) (if (and (setq ss (ssget "_:L")) (setq e (LM:SelectIf "\nSelect Block to Add Objects to: " '(lambda ( x ) (eq "INSERT" (cdr (assoc 0 (entget (car x)))))) entsel nil ) ) ) (progn (_StartUndo acdoc) (LM:AddObjectstoBlock acdoc (car e) ss) (_EndUndo acdoc) ) ) (princ) ) ;-------------------------------------------------------------; (defun c:Remove ( / *error* _StartUndo _EndUndo acdoc e ) (defun *error* ( msg ) (if acdoc (_EndUndo acdoc)) (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*") (princ (strcat "\n** Error: " msg " **"))) (princ) ) (defun _StartUndo ( doc ) (_EndUndo doc) (vla-StartUndoMark doc) ) (defun _EndUndo ( doc ) (if (= 8 (logand 8 (getvar 'UNDOCTL))) (vla-EndUndoMark doc) ) ) (setq acdoc (vla-get-ActiveDocument (vlax-get-acad-object))) (while (setq e (car (nentsel "\nSelect Object to Remove: "))) (_StartUndo acdoc) (LM:RemovefromBlock acdoc e) (_EndUndo acdoc) ) (princ) ) (vl-load-com) (princ) ;;------------------------------------------------------------;; ;; End of File ;; ;;------------------------------------------------------------;;
  3. Hi All Im sitting with at little quistion, because I have alot of dwg's with different blocks in them. I now need to change one specific block with another block. Since I have around 100 drawings where I have to change the block then I was hoping that there would be an easy way so I don't have to go in manually in each dwg. Can you help me or give me some hints on how to do this? FYI: I can not change the old block in block editor because I still need it.
  4. I made a Block Library with 4 objects in it, which I proceeded to insert into a drawing. However, only 2/4 of the objects inserted. The layers are not frozen, locked, or invisible. I've attached two screenshots. Please help me! I've been messing with this for hours.
  5. Using AutoCAD 2015 I received a drawing file that has a block and doesn’t show. The layer name of the block is thawed. I quick-select the layer name to check its presence in the drawing, the grip of the block appears, but the primary vector lines of the block itself are invisible. I supposed that the vector lines inside the block are frozen if different layer names were applied to those lines, but my layer manager shows all layers thawed. I invoked the block editor, searched the block name and launched the block session. Sure enough, the primary lines are there showing the drawn item, having the same name as the block layer name. I exited the block session without saving and wondering why the primary vector lines of the block are invisible. It’s only a block, it’s not an x-ref. How could this be?
  6. Hi everyone, I have a quite a specific question relating to auto-filling fields that are inserted into text. To give you some context I work in the lighting design industry and draw 2D lighting layout plans. I am currently trying to build a collection of dynamic blocks which contain attributes relating to their reference letter, circuit number, location, etc etc. This bit I have done quite easily. I plan to use these attributes to export to excel later, again something I already have working. The way our company labels the light fittings on plan is to use a leader. However if I have already given the block the information it requires for it attributes (and excel usefulness) I don't want to spend time typing it all out again in the leader. I have inserted some fields into my leader that recall the information I have stored in the block attributes but it is probably slower to insert them and click through the Field dialogue box than it is to just type in manually! What I want is to be able to have a generic leader with the fields that will refer to any given block (using the same names for those attributes) that when, for example the tip of the leader arrow touches a specific block the fields know that is the object they need information from, that way I don't have to right click each field and re-select the block manually. I just need a way of making this a one action process for each leader instead of having to do it for each field within it. I hope this makes sense to someone, more than happy to try and explain better if not! Many thanks, Matt
  7. Hello! I have a question like this before but after some answer and help i couldnt make it. I have googled for like 15 hours overall and this is my last way out What i need is to extract data of mutable drawings and change for example the description in the "drawing head". Not the same description for every drawing, thats why I need it to be in excel. "extract data" is good to get information out. BUT i cant get it into the drawings again... Please help me, and see attached for an example. thats the attributes i want to change. BR Johan All drawings.xls
  8. Hi. I'm trying to create a block-based multileader style in ACAD 2014 LT, but I'm running in a weird color behavior issue. below is the block used as the base as seen in block editor : The issue arise with the hatch. I've been using a version without a hatch for a long time without any issues ever, but I would like to have hatch so that I don't have to trim overlapping lines or add boundaries to background hatches, which make any kind of afterthought modifications a pain. In model space, everything seems fine : But when seen in paper space, the hatch suddenly takes the layer color (in this case, blue). It's the same wether the multileader is copied directly on the paper or viewed through a viewport. Why is this happening and is there a workaround? I can't use a wipeout because for some reason, I can't do an ellipsoid wipeout and you can't make an ellipse with polyline arcs. Thank you
  9. I have made a block that has been used in several drawings by several people. As the months have gone on and people have used these, some changes have been made to the blocks in the specific drawings. My question is this... Is there a way to update these globally? Almost like an XREF does but obviously not using an actual XREF. The only thing that i can think to do is every time one gets updated in a drawing, go into each drawing that the block resides in, delete them all, purge, reinsert, and have a copy party. Problem is, people change them without anyone else being informed...any ideas?
  10. Hello all, Im new here and learned alot from you guys. Now i have a problem that i couldnt find an answer to. I have one drawing template/ block with attributes. I want to insert my own templete/block but still use the attributes from the old one. This will be done at multiple drawings at once. I have tried the "extract Data" function but are unable to insert the information back again (multiple drawings) And the best option would be to insert the templete/block and the info without opening the drawings sepretely. If this cant be done in autocad, is there any other software available? See attatchment with 3 exmaples in one drawing. Note that the drawing templates are seperatly normaly BR Johan EXEMPEL template move.dwg
  11. Hi there, I'm looking for a Lisp routine that can count the number of one specific nested block (it will always have the same name) within a single layout, and then automatically insert the same block (which doesn't need to be nested) to differing coordinates depending on how many of that block there already is. I am having doubts to whether this would even be possible but I thought I would ask. Seeing as nested blocks can be counted through Lisp, I figured it might be possible. I've began to explore the world of Lisp and am using a few different routines currently. They work great but I am nowhere near at a stage where I can write a detailed Lisp routine myself. [using AutoCAD 2017 full version] Thanks guys, Kyle
  12. Hello, I have created a new .dwg file. Within the drawing I have created a block that updates when I change the parameters. Currently when I change parameter lengths the dimensions do not update to match the length of the block. Is there anyway to add dimensions that will update within the original .dwg file which contain the block. (AutoCAD 2011) Thanks,
  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 to all! I'am building the title block (block with attributes) and I need a routine that will automatically read layout name, in multi layout dwg, and write it into block attribute „LAYOUT“ for every layout. Field with Ctab doesn't suits my needs... Is something like this possible? Thanks!
  15. Full AutoCAD 2011. When inserting Obsolete Block the word Obsolete comes in oblique 28 degees, but all the other text remains correct. When opening block as a regular file all text comes in fine. This is only happening to me and not the other drafters. Am I missing a setting somewhere?
  16. Hi, I created some Dynamic Block and inserted them in a new Tool Palettes, but when I want to insert them in a new drawing the Block looses all the dynamic thing like rotation, flip... How can I solve this problem? Thank you. PID-SYMBOL.dwg
  17. Drawing3.dwg Hi, I wish to have a situation in which the intermediate dimensions change equally when I increase or decrease the overall dimension (see attached dwg file). And it is necessary to have the dimensions annotative. I tried using parametric dimensionsing along with block creation, but the drawing gets distorted. Does anyone have any ideas? Thanks in advance.
  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. I've spent some time writing up the following tutorial which aims to demonstrate how to construct a simple block counter and in the process give the user an introduction to association lists and dotted pairs: Building Association Lists: A Simple Block Counter The tutorial is a step-by-step walkthrough of the process of creating the block counter, with diversions here and there to explain the various concepts used by the program. Throughout the tutorial I've also tried to explain why every part of the code is used in the way that it is, rather than providing the reader with a block of code and leaving some parts without an explanation (for example, why the program should include (princ) or (prin1) as the last expression etc.). I welcome your feedback on the tutorial - Is it too simplified? Is it too long? Too boring? All of the above? Feel free to also point out any typos, as these can be difficult to spot when proof-reading your own work. Thanks, Lee
  20. Hello all, I have the following issue: When working with dynamic blocks, the file get's bigger fast. We have huge drawings in our company due to big projects. This is why I'm asking if it's possible to do something like an 'explode' on your dynamic blocks but without losing the 'blocks'. So if you have 3 dynamic blocks -> EXPLODE -> 3 sepperated blocks Without changing anything. Can you help me? PS. Block file in attachment. TestBlock.dwg Thanks!
  21. Hey all, this is my first post so I'm sorry if I violate any of the forum rules. I appreciate the help! I'm trying to write a script to get the latest revision number from our drawings, then save that info into a text or CSV file. Each drawing has a revision block like the image tagged below. How would I do that in LISP? Thanks!
  22. Hi All, I'm looking to see if there is a Lisp out there that as you copy a block in a drawing the first attribute with change in increments of 1 I.e. P1 P2 P3 Thickness " " " " Material " " " " (1) " " " " P1 Would be the attribute that changes every time it gets copied. Thanks Brain
  23. I am stuck on the syntax to write a block without user input. On executing the lisp, I want it to get a selection set from a variable and then write it to a new block without asking the user for input. The basepoint can be "0,0,0" and the file path is a pre-set path. The general command I'm trying to use goes like this (I know it's wrong, but I don't know where to go from here) (command "-wblock" "C:\\Users\\DefaultUser\\Desktop\\ScriptTest\\Blocktest1.dxf" "0,0,0") I've searched LISP routines all over the place but can't find one that does this. I'm mostly looking for examples that contain a similar line of code.
  24. Hello! I am having an issue with a block that a college made in Autocad. It is a block that shows which xref's that are attached to the drawing. But for some reason, the text in the block is not visable for me, but the block works fine for my colleges. Do you guys have any clues about this issue?
  25. DesmetMartin

    What layer is the object?

    Hi! My question is, when you have a block, in a block, in a block,... How can you know, by only clicking one time, in what layer a specific block or line is? Thanks! - DM
×
×
  • Create New...