AutoCad 2D :: Creating A Block That Does Not Prompt?
Mar 18, 2011
I have created a block attribute, but I want to be able to set it up so when I insert the block into my drawing, it does not prompt me to input a number in the Edit Attributes box.
I'm running AutoCAD LT 2011. As a test for myself when i first started using the program I created a block in which i have a rectangle and a linear stretch pair parameter attached to it, and a field attribute referencing the distance that the stretch parameter is stretched out to.
I'd like to know if its possible to set up a prompt when inserting the block into a drawing that allows me to type the desired distance of the stretch parameter and have the rectangle stretch to the entered distance as its inserted.
I'm trying to automate the process of simply inserting the block and then dragging the grips of the parameter out or updating the distance via the properties panel.
My vision is when someone inserts "block A", a promt will come up and ask "how many of "block A" do you need?" Based on how many you need, it will insert the block along with the arrayed amount the user has typed in.
I'm further developing our template and would lke to know how much trouble it would be (if any) to be prompted for several block attributes upon a new file being created (QNEW). The information in these blocks is found throughout the .dwg file and I'd like to reduce the amount of time going through each instance to modify (something that should have been done a long time ago).
Civil 3D 2012 Windows 7 Enterprise SP1 Dell Precision T3400 (Q9550 @ 2.83 GHz) 8GB RAM Nvidia Quadro GTX 650 Ti BOOST
I am able in lisp to create a command prompt selection menu, easy (see code below).However what I want is for the lisp to be ready to undertake an action UNLESS I select an option.
An example is the offset command wich has a function ready to roll (namely the specify offset distance) "OR" I can interrupt the "specify offset distance" and enter one of the sub options (in the case of offset Through/ Erase/Layer).
My code attempts to offset also, UNLESS the user wishes to specify a distance.
(DEFUN C:loadoffset ();CREATING MENU FOR SUB COMMANDS [GETIT] [GOTIT]...(setq choose (getstring " Select an option... [1=GET DIST] [2=GOTDIST]: "))(if (or (equal choose "1"))(GETIT))(if (or (equal choose "2"))(GOTIT));TERMINATING SELECTION MENU...)(defun getit ( gotit )(setq MYDIST (getdist " SELECT A DISTANCE: "))(gotit))(defun gotit ()(command "_offset" MYDIST pause pause"exit"))
How do I prevent "Edit Attribute" pop up prompt for entering text for an attribute in a block? I just want the same attribute text each time I insert the block, I don't want the "Edit Attribute" popup window to re-enter the same text every single time.
I do want the attribute text so mirror won't reverse it (I just want permanent attribute text).
First I delete the old regular text.Second I give the block an Attribute Definition Tag and enter the text I want in the Tag blank. Third I center where I want the text. Forth I save the block.
When I finally insert the block I get the "Edit Attribute" pop up to renter what I want it to say. Like I said earlier, I don't want this pop up, I just want to enter the text once and that's it. Also if I enter nothing in the "Edit Attribute" pop up, then no text will show on the block.
So I'm creating a block with a block table and constraints. The constraints such as Geometric Constraints work just as assumed. When adding in dimensional constraints we start to have more fun. So I have dimensional constraints that use other dimensional constraints to manipulate itself.
EX. dimconC = (dimconB-dimconA) dimconA is 12 dimconB is 14 dimconC would be 2 Now when ever dimconA or dimconB change dimconC would populate accordingly.
With this I wanted to make an attribute that could be placed in instead of a dimensional constant.
EX dimconC = ((Att1*dimconB)-dimconA) Att1 is 02 dimconA is 12 dimconB is 14 dimconC would be 16
However when trying to place in formula that references a attribute I keep getting an error "A DEPENDENT EXPRESSION CANNOT BE EVALUATED" So I assumed it was missing an expression from the attribute, however once entering an expression in for it I still get the same error.
(full error message attached)Constraint_Error.JPG
Is this something that is not allowed at all or have I over looked something?
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.
I have a A1 title block in model space that I like the look of. I'd like to duplicate this in A3 and A4.Is there a way that I can scale the A1 dimensions to A3 and A4 to avoid having to redraw them again with the appropriate dimensions?
ive got a block which ads a revision, description of change, drawn by and date to an existing titleblock. The small block has attributes, is there a way to make it so that when its double clicked it oped the ddatte dialog box? my comoputer is set so that when double clicking a block with attributes this happens which is fine, but on some of the other computers in the office it comes up with a different properties dialog box. I was thinking of a button which when clicked envokes the ddatte command for that block, I know how to do it in excel for eg but am just wondering if its possible to do something simialar in cad?
I did 19 drawings, created blocks using the CREATE button, at first I could Insert them into any other drawing. But I saw this definition in a book,
Creates a block from separate entities (internal to current drawing), does this mean that a user on another computer cannot use my block unless he has the original drawing?
My boss told me that he uses WBLOCK instead, which writes to an external file.
I'm asking because out of the 19 drawings, 9-10 of them have the error "block referencing itself". I guess this is probably me naming the blocks the same as my file names.
So before I go any further, what is the proper way to create a block that can be used? I also shared my CAD folder on the network.
I am trying to cut out a logo from a 3D solid. Essentially the thing I'm trying to 'cut' is a box, simple. However, the logo I has is reasonably complicated and a conversion to DWG from an Illustrator file.
I have tried creating the whole thing as a surface, no luck
Tried exploding it into both lines, polylines and splines, no luck
The nearest I get is a long winded way round. Im having to joins the splines, then convert to polyline, then convert to surface, then thicken the surface. This would be ok, but there's lots of text and so on.
I just wondered if there's a simple way of doing it that I've missed? Such as "cut these 2D lines out of this 3D shape" command and then delete the sliced out pieces I don't want.
I am in the process of creating a few really useful dynamic blocks. My problem is I wish to collect them in a library folder so each block is a stand alone dwg file. I know I used to to this in 2011LT, but that was some time ago and I have since changed company and we have 2012LT. I cannot for the life of me remember how to do this.
I have tried to do it the usual w-block way, but when I import them into a new drawing they are actually a block within a block. Is there a better way of doing this?
I am using AutoCAD 2012 and have made lots of different files with individual drawings in them. I am planning to go into each drawing file and create a block for the drawing. After that I want to make all the blocks available in one drawing.
Is there anyway of re-naming an existing block without creating a new one? I made a rookie mistake of naming my blocks with names containing spaces i.e. 'block A' and 'block B' and have found that some routines like replace block won't work because of it.
I am trying to create fields for a title block and then link them to a sheet set. I want to use my title block as a x-ref and not a block. Everytime i try to create attributes for it and then use the command Battman then it says there are not attributes created. I am now at a stand still on how to creat fields for my sheets and then link them to my sheet set.
I am trying to create multiple block missing in our database, actually i have all the measurement of the fitting inside excel this is mostly elbow and T fitting.
I was thinking of a dynamic block with editable lenght (strech parameter with a mix of constraint). but before digging too deep in a wrong direction i want to ask community if something similar already exist?
I'm trying to create blocks on the fly by drawing a polyline, using a jig, and then grabbing that polyline and creating a block from it.
I'm not interested in block names, so anonymous blocks seem to be the way to go. I've successfully managed to create the block and even add attributes to it. However, if I try and use battman or attsync AutoCAD tells me that "This drawing contains no attributed blocks." I can however double-click on the block and go to the enhanced attribute editor, which shows me the attributes with the tags I've given them. Exploding the block reveals that there is no nesting occuring.
My attributes seem to be stck in limbo...
The function that creates the stand is:
{ Transaction trans = ed.Document.TransactionManager.StartOpenCloseTransaction(); try { //create new instance of the polyline jig polylineJig.polylineJig plJig = new polylineJig.polylineJig(); promptStatusResult = plJig.newJig(); if
I am trying to create a block with 1 attribute (ELEVATION) showing a finished floor level and another text (field) to show another level derived by the sum of the attribute value + and additional (fixed) number, say 100.
I have tried using fields inside an ATTRIBUTE or a simple DTEXT but the field does not update, it only picks up the DEFAULT of the attribute, not the user entered input. How can I do this?
I am not sure this is even possible, but could I use some sort of invisible block attribute data and everytime I insert it into a drawing (I use the same block multiple times within a drawing) it would autopopulate fields in a table. For example I have a smoke detector symbol I insert, I also have a specific address associated with every single detection symbol I insert into a drawing, would I be able to attach data such as what type of detector it may be and have the address and type automatically populate in a table everytime I insert my block into a drawing?
I'm having a small problem with creating a flip state for a dynamic block that has 3 visibility states.
The visible/invisible parts of the block won't flip even though I have created 3 flip states (one for each visibility state) and selected all of the parts of the block I want to flip each time.
I'm having trouble getting my attribute definitions to work with my blocks.
I'm trying to create a tag that can flip around (dynamic) and have a tag number easily entered (attribute).
I notice that I could only get the attribute definition to work during a drawing insertion is when I wblocked out my block and inserted that drawing file. I was not able to insert the drawing file that had the block in it.
I can't seem to make a dynamic block drawing file, and then insert that dynamic block drawing file if I want the attribute to work..
I'm new to .net for autocad, but very familiar with c#. I studied some samples about creating a block from c#. I have a form for some basic input. When the user presses OK the code checks if the blockname is already in use. When no it creates the block using following
What I want is to create a block which contains a bit of text displaying the scale (X scale only) of the block. Then, if I change the block's scale it will also update. Is this possible?
I am attaching my dynamic block that I am having difficulty finalizing. My goal is to be able to stretch or resize the hvac block, based on the size that is provided to me (ala 24x24, 36x36, 48x72, etc) (Stretch Action), I have that figured out, and I have the symbol in the center that stays centered as the block size changes, (Move Action).
Here is my problem, I want the symbol in the center to stay centered and scale based on a ratio as the overall size gets larger. So for example: if my size is a 24"x24" I want the symbol in the center to be approx 12" dia, but if the size gets up to say 60"x60" I want it to scale accordingly (so it could be like 48" dia), specifically maintaining the size based on the x axis, so if the it gets to a 60x72", I'd like it to still be centered but size according to the 60 width, and not stretch and look awkward. I want the center symbol to scale and stay centered in the rectangle as I scale the size.
I've got a problem with creating Path in Inventor VBA. I've created a source block definition in SourcePart.ipt, derived it in DestPart.ipt, placed this derived SketchBlockDefinition in Sketch3 and draw 3 extra lines. Now i want to add a SplitFeature with SplitTool as a Path of 3 lines, but first i need to create this Path. There is no problem with creating path from this 3 extra lines, but when i want to create path from lines that belongs to derived block - an error occurs.
Below is sample code (also included in attached file - DestPart.ipt). Try run it with DestPart.ipt as an active file. When Inventor is prompting for Selecting Sketch Entity first select one of 3 extra lines, macro ends with no errors. Then run it again, this time select one of 3 lines that belongs to SketchBlock - an error occurs.
When you try to add SplitFeature (Trim Solid) by UserInterface Button "Split" there is no problem with any set of 3 lines.
Sub CreatePathTest() Dim oPartDoc As Inventor.PartDocument Set oPartDoc = ThisApplication.ActiveDocument Dim oPickedSketchEntity As Inventor.SketchEntity Set oPickedSketchEntity = ThisApplication.CommandManager.Pick(kSketchCurveFilter, "Select Sketch Entity") Dim oNewPath As Inventor.Path Set oNewPath = oPartDoc.ComponentDefinition.Features.CreatePath(oPickedSketchEntity)End Sub My System is Windows 7 32bit/64bit, Inventor 2012
i'm looking to select a block reference, take it's wcs position, translate the coordinates to the current ucs and then create an xline using those translated coordinates. simple, right?
i simplified some code to test that i could properly build an xline in a current ucs. i just threw in static point3d values instead of grabbing them from another object. it worked as expected:
<CommandMethod("test")> _ Public Sub test() 'get the active document, editor and database Dim acDoc As Document = Application.DocumentManager.MdiActiveDocument Dim acDocEd As Editor = acDoc.Editor Dim acCurDb As Database = acDoc.Database 'start a transaction Using acTrans As Transaction = acCurDb.TransactionManager.StartTransaction() 'open the table for read Dim acBlkTbl As BlockTable acBlkTbl = acTrans.GetObject(acCurDb.BlockTableId, OpenMode.ForRead) 'open the record for write Dim acBlkTblRec As BlockTableRecord acBlkTblRec =
[code]...
here, i revised the code so that a block reference's objectid is passed from another procedure, the origin is determined, translated to the current ucs and the points are tailored for the xline's basepoint and secondpoint. i threw in a few writemessages to ensure that the coordinates were indeed what i was looking for and they match up, but for some reason, the xline now fails to create itself.
'define the current ucs Dim ucsDesign As Matrix3d = acDocEd.CurrentUserCoordinateSystem 'start a transaction Using acTrans As Transaction = acCurDb.TransactionManager.StartTransaction() 'open the connector block for read Dim acBlock As BlockReference = acTrans.GetObject(idConnector, OpenMode.ForRead) 'save connector origin Dim ptOrigin As Point3d = acBlock.Position 'translate the point to the current ucs Dim ptUcsOrigin As Point3d = ptOrigin.TransformBy(ucsDesign.Inverse) 'show me the block position acDocEd.WriteMessage(vbLf & ptOrigin.ToString()) acDocEd.WriteMessage(vbLf & ptUcsOrigin.ToString()) 'open the table for read Dim acBlkTbl As BlockTable acBlkTbl = acTrans.GetObject(acCurDb.BlockTableId, OpenMode.ForRead) 'open
[code]...
i've rearranged this code multiple times, tried a couple different approaches, scoured the forums and even resorted to the less-than-elegant: