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. Can a AutoLISP command be written to read an attribute in a block and draw a circle with the attribute as the diameter using variables? The appilcation is taking the diameter of a tree trunk (the attribute), multipling by 12, and drawing the canopy circle on hundreds of those blocks. So the circles drawn will vary in size. Not sure how this could be set up, i'm NOT familiar with LISP writing AT ALL. 1) Read block, single, mulitple or definition? 2) Read Attribute 3) Varaible of attribute, (attribute is an inch measurement...it needs to be multipled by 12 to get feet for final use as circle diameter drawn) 4) Draw circle, variable, with diameter coming from attribute variable (attribute in inches that is multipled by 12) 5) Center point or circle to be block's base point Thanks everyone, always such great help here!
  2. Please help! Every time I insert a block (dynamic or otherwise) into any drawing (I have tried several) my ucs (0,0) changes to the insertion point of that new block. I don't know what I have done, what button I have inadvertently pushed or setting that I have set, but I do not know how to undo this! Has anyone ever heard of this? Please help me! I am using AutoCAD 2014.
  3. Hi guys, I have a requirement to create a block with a few attributes, but the attributes require a bit of composition behind the scenes. Here's an abstract example. I need a block that represents a computer's identity. Each computer has 2 references that need to result in attributes that I can extract. One attribute is a unique reference across the project, and the other attribute is a room reference, and many computers can be in the same room. Here are some example references. Computer A Unique Reference: DF.SALES.01 Room Reference: DG.SALES.07 Computer B Unique Reference: DF.SALES.02 Room Reference: DG.SALES.07 Computer C Unique Reference: DF.SALES.03 Room Reference: DG.SALES.07 Computer D Unique Reference: DF.ADMINISTRATION.01 Room Reference: DG.ADMINISTRATION.02 Computer E Unique Reference: DF.ADMINISTRATION.02 Room Reference: DG.ADMINISTRATION.02 As you can see from the above, the 'common' part for a computer is the middle 'SALES' or 'ADMINISTRATION' part, which 'technically' only needs to be put in/typed in by the user once for each computer. I need to automate this process to reduce user input error, such that they only enter 'SALES' or 'ADMINISTRATION' once and don't end up creating the below, which would be invalid. Computer F Unique Reference: DF.RECEPTION.09 Room Reference: DG.SALES.07 Thus I imagine I need a third property/field/attribute to specify 'room', and then formulate the Unique Reference and Room References, using this 'room' part in the middle. The end goal here is that I need to be able to extract the above two references for each 'computer/block' and get them into Excel, and I need to be able to modify the 3 properties (room, unique reference and room reference) quickly, ideally using something like EATTEDIT, which is how we have edited attributes in the past. Apologies that this may seem like an odd request! The use case above is abstracted, it's actually not for computers at all but I figured it would make more sense than complicating it with the actual application! Many thanks in advance for any thoughts.
  4. Hi all, Query regarding layer control with blocks and stuff. Traditionally to represent a computer on a drawing we would place two blocks, one would be the computer symbol itself, and one would be a unique reference (that we could attribute extract) directly above it. These two blocks, the symbol and the reference, would go onto their own two individual layers in the final drawing so that we could control the visibility and the colour of both the symbols and the references individually. The layers, for example, would be called: Computer Symbols Computer References Both of these blocks would be drawn in BEDIT on Layer 0, such that they take the properties of the layer that they are eventually inserted on. I'm looking to combine the two blocks into one, but would still like the individual layer control. Is there a way I can combine the two blocks while still maintaining this individual layer control? I'm thinking that I'd have to draw the symbols and references on the above layers as opposed to Layer 0 in BEDIT, and then my 'new block' will probably have to go on a new 'total' layer like: Computers Computer Symbols Computer References So then I'd insert my 'symbols+references' block onto the 'Computers' layer. I don't really like this idea too much because it seems like I'm overcomplicating things (highly likely!). I guess what I'm really after is a 'symbol+references' block that moves as a group, but I can control in my traditional two layer approach. Maybe this is the only way. Any thoughts? TIA!
  5. Hello, I have been a lurker on these parts for a while, now i need help with a problem of my own. (I use autocad mechanical 2013) I have a cad drawing which contains 1000's of blocks, each with its own part reference within. As we use autodesk Vault and cad's design centre in tandem both the block name and partref description need to match. At present many block do not. What I am investigationg a a lisp type routine which will automatically rename all blocks in a drawing with its part reference description. As I am a novice with lisp I would like the forums help with this. Kind Regards, lladoog
  6. I have two different blocks overlapped on each other which have similar or same geometries. I want to verify the visual difference on both the blocks. I want to verify if the vendor block contains the same geometry as mine. Here is what I'm thinking and Need lisp for: I want to select the first block, deselect it, select the other one, deselect it and then this process should be looped till I can visaully find difference between blocks by select/highlight method without grips. If possible to add timer between selection & deselection process would make things easier and allow zoom and pan while still looping. Can anybody help me please?
  7. I have made a few blocks that contain a few attributes. I have populated the Tag, Prompt, and Value for each block. When I insert the block the value seems to take on a life of its own and populate with text different than what I have entered. Any Ideas?? Block.dwg
  8. Morning again, Is there a lisp or piece of code that would change the contents of a block to Layer 0, so I can set it down in my Layering Standard rather than the standard the block was created in (not by me). Look forward to hearing from you Stenna
  9. I'm creating a block with a block attribute. In the blockeditor I can change the draworder so the attribute is partly under some lines. But the draworder in the blockeditor of the attribute doesn't work in the normal modelspace; the blockattribute is allways on top. Can anyone tell me how to fix this? block.dwg
  10. Elevator Man

    Pull Down in Block Attributes

    Is it possible to make a pull down inside of a attributed block? For example: if I a have engineering code section of a title block and I want to be able to choose from a list of codes: ASME A17.1-2004 ASME A17.1-2007 ASME A17.1-2010 ASME A17.1-2012 Can I set up the block to let me do that?
  11. Hey all, I was wondering if it is possible to use dynamic blocks to stretch a rectangle evenly, using only 1 point? I have attached a PDF of a rectangle with 2 lines coming out of each side (before & after picture). I want to use dynamic blocks to pick a point at the top right of the block, so that when I pull it out, the lines will extend, but stay attached to the rectangle. I also what the rectangle to stay in the center at all times. If you can understand, please help! Is this possible? Block Stretching.pdf
  12. Hi all, I have a dynamic block of some door hinges. Depending on the height of the door, depends on the type & quantity of hinges used. I was wondering if it is possible to have a block that detects height? If I insert the hinge block onto my drawing, and snap the base point of the block to the bottom left of the desired door, stretch the pick point to the top, I would like it to automatically change from 2x small hinges (for doors under 312mm high), to 2x large hinges (for doors under 1000mm), and finally to 3x large hinges (for doors over 1000mm)? I have attached a PDF for visual reference to what I'm talking about. I have no idea on any 'Lisp/VBA/Scripts' in AutoCAD, so any suggestions would be greatly appreciated. Thanks, drafting3. DOORS.pdf
  13. Hi all, I have got this code by KEAN WALMSLEY. His code will ask user to select a block and then list all of selected block's attributes. However, I need to tweak his code a little bit and instead of user interaction, the block has to be selected by its name and through my code. Here is his code (with slight changes to suit my purpose): Private Sub ListAttributes() Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor Dim db As Database = HostApplicationServices.WorkingDatabase Dim tr As Transaction = db.TransactionManager.StartTransaction() Try Dim filList As TypedValue() = New TypedValue(0) {New TypedValue(CInt(DxfCode.Start), "INSERT")} Dim filter As New SelectionFilter(filList) Dim opts As New PromptSelectionOptions() opts.MessageForAdding = "Select block references: " Dim res As PromptSelectionResult = ed.GetSelection(opts, filter) If res.Status <> PromptStatus.OK Then Return End If Dim selSet As SelectionSet = res.Value Dim idArray As ObjectId() = selSet.GetObjectIds() For Each blkId As ObjectId In idArray Dim blkRef As BlockReference = DirectCast(tr.GetObject(blkId, OpenMode.ForRead), BlockReference) Dim btr As BlockTableRecord = DirectCast(tr.GetObject(blkRef.BlockTableRecord, OpenMode.ForRead), BlockTableRecord) ed.WriteMessage(vbLf & "Block: " + btr.Name) btr.Dispose() Dim attCol As AttributeCollection = blkRef.AttributeCollection For Each attId As ObjectId In attCol Dim attRef As AttributeReference = DirectCast(tr.GetObject(attId, OpenMode.ForRead), AttributeReference) Dim str As String = (vbLf & attRef.Tag + " " & attRef.TextString) ed.WriteMessage(str) Next Next tr.Commit() Catch ex As Autodesk.AutoCAD.Runtime.Exception ed.WriteMessage(("Exception: " + ex.Message)) Finally tr.Dispose() End Try End Sub Now, I need to change this Sub to a Function as below: Private Function ListAttributes (blockName As String) As Boolean The goal is to list all block attributes if the 'blockName' exists in drawing and return True afterwards. Oppositely it should return me False and print nothing to Editor if blockName does not exist. Can anyone help me please? Cheers
  14. Hi all, I have a dynamic block of some door hinges. Depending on the height of the door, depends on the type & quantity of hinges used. I was wondering if it is possible to have a block that detects height? If I insert the hinge block onto my drawing, and snap the base point of the block to the bottom left of the desired door, stretch the pick point to the top, I would like it to automatically change from 2x small hinges (for doors under 312mm high), to 2x large hinges (for doors under 1000mm), and finally to 3x large hinges (for doors over 1000mm)? I have attached a PDF for visual reference to what I'm talking about. I have no idea on any 'Lisp/VBA/Scripts' in AutoCAD, so any suggestions would be greatly appreciated. Thanks, drafting3. [ATTACH]41844[/ATTACH]
  15. Hi all, I have a dynamic block of some door hinges. Depending on the height of the door, depends on the type & quantity of hinges used. I was wondering if it is possible to have a block that detects height? If I insert the hinge block onto my drawing, and snap the base point of the block to the bottom left of the desired door, stretch the pick point to the top, I would like it to automatically change from 2x small hinges (for doors under 312mm high), to 2x large hinges (for doors under 1000mm), and finally to 3x large hinges (for doors over 1000mm)? I have attached a PDF for visual reference to what I'm talking about. I have no idea on any 'Lisp/VBA/Scripts' in AutoCAD, so any suggestions would be greatly appreciated. Thanks, drafting3.
  16. Hello, My goal is to set up a batch printing on all AutoCAD drawings. Each drawing will have a record similar to this: The PartNo records underlined in red are other drawings that my recursive function will go through. That's why I must access this information. I believe I must access an object named "BLOCKNT" in order to do so but I'm unsure about the syntax. FYI, for some reason, whenever I try to use this code: ApplicationServices.Application.DocumentManager.MdiActiveDocument I get the following error: This is a .exe application and I have read that I cannot use NETLOAD commands in a .exe project? Does this make sense? Thank you! Alex
  17. Hi, I'm trying to delete a unused layer. But when I do that I get the following error (see attachment). I googled a bit and figured out that the LAYDEL command might solve my issue, but as I'm using Autocad 2013, that's not possible, as it doesn't have this command... Any id's how to solve this? The block that causes the error can also be deleted, I tried with the purge command, but must be doing something wrong cause it didn't work. Oh yeah, with regard to the purge command, I see it this way (attachment 2), how can you display it in a window kind of view to get a better overview? Best regards, Vincent
  18. Hi All, What i'm looking to do is block multiple objects by windowing all of them at once and have them save as sepearate blocks and using the label in the middle as the block name. I guess the big question is it even possible to do this? Brian block dwg.dwg
  19. Help anyone? http://www.theswamp.org/index.php?topic=44203.0 Thanks, Reuben Shilling
  20. AutoCAD entity using its handle, and zoom from child to parent block, here i used tag name of child block as "REMARKS" and value inserted Parent block handle from Excel. I found some lisp from internet, but showing error, anyone can correct it..? thanks, (defun LM:vl-GetAttributeValue ( block tag ) (setq tag (strcase tag)) (vl-some (function (lambda ( attrib ) (if (eq tag (strcase (vla-get-Tagstring attrib))) (vla-get-TextString attrib) ) ) ) (vlax-invoke block 'GetAttributes) ) ) (defun c:test ( / ss ) (if (setq ss (ssget "_+.:E:S" '((0 . "INSERT") (66 . 1)))) (princ (LM:vl-GetAttributeValue (vlax-ename->vla-object (ssname ss 0)) (setq ent_handle (setq Mystring "REMARKS")) ) ) ) (command "Zoom" "Object" (handent ent_handle) "") (princ) )
  21. Right now I have 15,000 drawings that use letters instead of symbols, an artifact of a now defunct CAD software that translated the letters into symbols. I'd like to remake this in AutoCAD by inserting blocks at the location of those letters. I cannot find instructions on how to do this anywhere, and I need to add the following things to my code: 1 - Insert a set of blocks from another drawing. 2 - Select a specific letter from text in a specific layer in code 3 - Insert one of the newly inserted blocks at the insertion point of the letter 4 - Delete the character as it is no longer needed (unless it was replaced, then it wouldn't be there anymore) Example: Import set of blocks from template drawing. Select from layer "Curb Valve" the character "R" from a piece of text in the layer (exact match preferred if possible). Replace this symbol with a block named "CurbValve." I know you can get the X,Y of the text letter and manually type that in when you manually insert a block, so if you can detect this somehow and assign it to a variable, then use that variable to use as the insertion point of the block it would work. I just haven't been able to figure out how to do it programmatically. Thank You!
  22. I would like to add a drop down list to a block. I would appreciate any help in getting this set up. Ive done a fair amount of research and it appears that things much more complex can be done but this simple task has me stumped. Background: We use the same block (symbol) to represent several different part numbers, but would like to select from a drop down list the actual part number. For example, a beacon symbol is the same no matter what color the beacon, but i would like to be able to select a grip and choose red, green, blue, yellow, ect. I don't want it to do anything to the block, but rather just store the property that is set by the user. Any help would be greatly appreciated. I'm sure this isn't that hard, but i cannot figure it out. Thanks
  23. Greetings to all. I would like some help in how to create a switch plate dynamic block. I can draw the light switch inside block editor no problem. My Objective: To insert a single light switch plate block into a drawing and have the ability to stretch the block to increase the number of switches from 1 to as many as 10 in a gang style. The light switch box would do a basic stretch, but I just can't figure out how to increase the number of switches as the block increases in width. I hope this makes sense. Thanks
  24. I would like to extract a furniture schedule by using attributed blocks. I would like attributes like Item #, Color, Size, Location, Description, Manufacturer, etc…. The problem with the data extraction system that I am having is that in order for a chair with a tag to be considered the same chair and be counted correctly all the block attributes have to be exactly the same/ match. For example, if I have the same chair (CH-01) but the location of the chair changes, cad treats it as 2 different chairs. Anyone know of a solution to this issue I am having? THANK YOU!
  25. So, to give some background information, I have 0 experience with LISP programming, and am an intern at an engineering company. I really would love to score "brownie points" by automating an extremely boring and time consuming task. I have experience with other languages, and can work off of a good base. So here's what I would like the routine to accomplish: 1.) Figure out the name of the title block (the title block will be in the same location on each and every file) 2.) Use that name to modify 5 attribute values of that block (each title block has the same attribute tags: NAME, DRAWING_NUM, SN, DATE, DESIGNER) 3.) Save in a new location. So, for example, lets say the drawing I want to modify is at the location C:/USER/ME/, and is called drawing1.dwg. Lets say that it's title block is called "blanksheet", the routine then needs to modify the 5 attributes (NAME: DrawingName, DRAWING_NUM: 123456, SN: 000, DATE: 10 10 12, DESIGNER: Me) of the block "blanksheet". Then, after it modifies everything, saves it in the location C:/USER/YOU, and is called drawing2.dwg. I'm not even sure if this is doable within the bounds of AutoLISP, so any feedback is appreciated. Thanks in advance!
×
×
  • Create New...