AutoCAD Dynamic Blocks :: Diesel Expression That Read Object Length
Jan 10, 2014
I created a dynamic block with text field that show the lenght of a line, but this line can be 0 and in that case I want that the text field will show nothing instead of "0".
I try to write it in diesel expression with if command but i don't know how to bring the object lenght into the diesel expression code.
I have a task where I need to automatically insert the drawing number (no path), plus two additional items, one an attribute, the other is within a dynamic block. I can achieve this using fields but now I havce to truncate some of the text.
It seems like I can't edit if I am using fields and attributes/blocks can't be used in Diesel (correct me if I'm wrong)
This is the information I have:
Filename: 123456-AS-WE.dwg Attribute: Q2 Dynamic Block: X1 - Additional Information
This is what I require: 123456-AS-WE [Q2] [X1]
This is what I have so far: 123456-AS-WE [Q2] [X1 - Additional Information]
In other words, I need to restrict the dynamic block field to the first two characters.
Change the 24 x 24 x 12 MLeader in this Block to Fields that read the length of the Lines that the Distance1 and Distance2 Parameters are attached to and tell me if it crashes? And if it does not crash, post a working DynBlk.
Is it possible to change the length of a line based on the length of an attribute?
I'd like to make the line a MINIMUM length of X" (I haven't decided how long yet--but know I'll need a minimum). But then after the user fills in the attribute, I'd like the length of the line to change to the length of the attribute plus a small amount (again, I haven't decided yet how much extra).
I was wondering if there is a way with DB's to have a line "follow" or "grow" with the content/value length of an attribute. Maybe some method of linking the attribute width to length of the line? Essentially, it would work just like turning on the underline setting when typing in mtext editor (or any program with an underline option for that matter), expect that the line could be placed anywhere, and would not have to reside directly below the text.
Using expressions/formulas in a dynamic block. I want to create a dynamic flat truss with webbing, where you can select the number of V webbs and as your stretch the length of the truss the vees stretch accordingly. With the array parameter, you seem to be limited to predefining a spacing and the number of instences increases as you stretch the object. I want to set the number of instences and let the spacing change. In particular I have tried using the Parameters Manager to create a user parameter that takes the lenght of the truss and divides it by a number. When I try this AutoCAD gives me "A dependent expression cannot be evaluated" It appears that all of the Action Parameters cannot be used in expressions which really limits things.
have a diesel expression that would read a layout tab? for example if i have a layout tab names 244180101 I would need it to read the last 2 digits in the layout tab.
AutoCAD Civil 3D 2014 HP Z620 Workstation 64-bit Duel Intel Xeon E5-2620 @ 2.00 GHz Ram: 48 GB
I have a multileader balloon that I want to have a field that is a diesel expression that will allow me to select a block and extract the attribute value within that block. Is there anyway to do this?
I have been asked to make the title text larger (drawing are being issued at 1/2 scale, A1 to A3) on a large set of drawings. My solution was to copy the title attribute block to a temporary location, resize the attributes and redefine the block by running a script (scriptpro). Some drawings needed the title line split to next line so I had to move the sheet counter (1 of xx, 2 of xx etc.) which was linked to drawing file name for number with a field/formula.
The diesel expression shown below extracts that number. My problem is I cant figure out how to I can edit this expression to allow for a set not starting at 1. I had used a formula to subtract the difference,but how do you express this to run in a script?
-you have a dynamic block with a grip that allows for any adjustable length.
-assume i need a the block to be 500mm long
-i stretch the block 500mm long in CAD (but it is still dynamic and will let me grip the length and adjust).
-after I insert it and set the 500mm length, can I somehow LOCK THE 500 LENGTH, so you cannot grip and edit the length anymore???? (but also have an unlock function for later)
This would be very useful in the following situation: Doing elevation view of a building with wall connections between floors....There would be MANY of these dynamic blocks....But they should all be the same length, per floor...But the next floor may have a different length....So I want to be able to Set Length > then lock in place... (and be able to unlock whichever I want, and adjust appropriately where the connection gets longer/shorter at another location...)
is there a way to associate a stretch action with the length of an attribute value (i.e. # of characters in the string) or is this something left to vlisp?
in order to streamline some of my duties i wonder if theres a way to have a dynamic block not only that can change it's length and the dimension for that length (easy) but will also add features to the part. For example can one be made that when stretching its length that once it reaches a certain length automatically split into two sections and keep those 2 sections equal? Also can it be made to contain a tag that keeps track of the lengths as well as number of joints between sections multiplied by a constant?
I am creating a dynamic block of a conveyor belt it has a set number of widths and needs to be stretchable in length, which I have managed to do. The motor is placed half way down the length of the conveyor and needs to stay centered
I know I need to use the move command and put in a factor of 0.5 somewhere, but I can't remember how to do it.
I'm trying to create a pline in a dynamic block where the length is determined by two values I would input into properties or as attributes.
The first value 'A' will be a ground surface elevation
The second value 'B' will be a ground water elevation
I would like to the pline to have a length of A minus B.
I would then also like to have mtext (or any other method of display text) to display the values of A and B.
For example, if I have a ground surface of 102 and a ground water of 91, my line length will be 11, and I can display a label of '102' at the top of the line and '91' at the bottom of the line.
I've created dynamic blocks before, but none that have used an expression of two values or having to display inputted values. I'm not really sure where to start with this, or if it's even possible.
I'm trying to loop through blocks in paperspace for a specific name and then edit it's attributes. The code works fine if the block is a standard block, but does not see dynamic blocks.
I have looked through other posts and can see how there is a is dynamic property, but just don't know how to apply it here. The function i have to update the attributes expects the object id of the block. Just don't know how to get that if the block is dynamic.
Dim TbloOjbectID As ObjectIdDim mydb As New Database(False, True)mydb.ReadDwgFile(Newfname, FileOpenMode.OpenForReadAndWriteNoShare, True, "")Using Trans As Transaction = mydb.TransactionManager.StartTransaction() Dim myblocktable As BlockTable = mydb.BlockTableId.GetObject(OpenMode.ForRead) Dim mypaperspace As BlockTableRecord = myblocktable(BlockTableRecord.PaperSpace).GetObject(OpenMode.ForRead) For Each myBTR As ObjectId In mypaperspace If myBTR.ObjectClass.DxfName = "INSERT" Then Dim myBref As BlockReference = myBTR.GetObject(OpenMode.ForRead) If UCase(Left(myBref.Name, 4)) = "TBLO" Then TbloOjbectID = myBref.ObjectId If DwgTitle.Length > 0 Then SetAttribute(TbloOjbectID, "PROJECT/CONTRACT_NAME", DwgTitle) End If End If End If Next Trans.Commit() End Using
I have an arrow in my Dynamic Block which I can rotate to the north. But is there a commando that the arrow will rotate itself to the UCS? See drawing file.
How to set up a dynamic block so I can control the size of an object through parametric dimensions that are linked (somehow) to a lookup table, spreadsheet, list, etc.?
What I'm trying to do (simplified) is place a block of a rectangle, select a size from a dropdown list, and have the block change to be that size - but I don't want to do this through visibility states as there are hundreds of sizes. The whole point is to be able to construct a list, lookup table, excel sheet, etc and link it to parametric dimensions in the block, or at least be able to link a stretch action to parametric dimensions. But the block editor will not allow me to associate a stretch action with a parametric dimension (at least I haven't figured out how to do this.)
I've made annotative blocks and I've made dynamic blocks... My intent is to integrate both but I can't find a way to move dynamic block parameters separately at different annotative scales.
In other words, if I insert an annotative dimension and add multiple scales I can move the dimension grips independently at each scale. If I insert a dynamic block I want to be able to use the dynamic block's action "grips" to do the same. However, with a dynamic block, if I move a stretch action at one annotation scale it moves the action at all annotation scales.
I have created a dynamic block with several visiblility states. The block works great for what I need it for. however, I am trying to add one more action to the block but am having issues.
This block is essentially a 24" retail cabinet with the visibility states showing the different drawer and shelf configurations. I want to be able to lengthen the cabinet in 24" increments and have the visibility show for each 24" section.....e.g. I want a 10' cabinet so I bring in the 24" starter block. Then stretch the cabinet to the 10' mark, then I can chose any drawer/shelve config for each 24" section (they are all different).
I can get the block to stretch in 24" sections....no problem.....i just want the visibility state to be duplicated as well for each section. Now as it stretches, there is only one Vis state and it only populates the first cabinet.
I could do this by copying the block over and over 5 times.....but I am hoping there is a way to make this dynamic.
I have a block I am making into a Dynamic Block. I will be adding in different visibility states. Depending on the visibility state the block would need to be inserted from a different point.
My question is, is it possible to add multiple insertion points to a dynamic block so depending on the visibility state it defaults to the correct insertion point?
I know this is located in other locations but I can't seem to make it work with my block.
I would like the cross and the text N to rotate independantly of the arrow while the N stays with the thick line. That's the easy part. How can I make the N move along the rotation path and keep the text aligned horizontally? I read something about linked action and move, but I can't make it work.
Is there anyway to link standard AutoCAD Grips and there commands to Dynamic Block Actions? I want to stretch an arc by its midpoint grip. This accomplishes something that no other commands do.