Search the Community
Showing results for tags 'dynamic'.
-
I need help in debugging the following code: (defun c:spool_labels ( / prefix cnt pt ol) (setq prefix (getstring t "\nENTER PREFIX: ") cnt (getint "\nENTER INTEGER TO START: ") ;; value to start the counter at ol (getvar 'clayer) oa (getvar 'attdia) ) ;; Turn dialog off for the attributes (setvar 'attdia 0) ;; Create layer for the blocks to be inserted on (command "-layer" "make" "Blocks-Spool Label" "color" "magenta" "" "") (while (setq pt (getpoint "\nPICK INSERTION POINT: ")) ;; get insertion point for block (command ".-insert" ;; command to insert a dynamic block "_MP Spool Label" ;; name of block to insert pt ;; insertion point for block 1 ;; scale value for the block 0 ;; rotation value for the block ;; concatenate the prefix to the counter for the name (strcase (strcat prefix (itoa cnt))) ) ;; increment the counter (setq cnt (1+ cnt)) ) ;; restore change system values (setvar 'clayer ol) (setvar 'attdia ol) (princ) ) The output of the code: Command: SPOOL_LABELS ENTER PREFIX: 4" CND # ENTER INTEGER TO START: 1 PICK INSERTION POINT: Unknown command "\". Press F1 for help. Block gets inserted but the attribute does not get filled in. Any help with this will be greatly appreciated.
-
Hello all, I should get the following code changed so that you can select the blocks you want to 'undynamic" first. Can somebody help me? (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 (strcat (vla-get-EffectiveName insert) "_00") 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))) ) Credits to TP from theswamp.org. Thanks, Martin.
-
Generating a "Table Row" block
DJAW posted a topic in AutoCAD 2D Drafting, Object Properties & Interface
Working to standardize a bill of material drawing that must consist of nothing more than text, lines, and blocks for a client that refuses to use datalinks and I was hoping to find a way to create a standard block that could act as a row in the table with cells containing text fields. Essentially, I would like to have the functionality of attribute definitions but have them copy down using some kind of array action. Has anyone had any luck/experience with something like this? I understand it's might be kind of impossible. Attached is what I'm hoping to have as default text in the newly generated row as the user pulls down the array arrow. -
I had this awesome code from Lee Mac about aligning a block to an object and wanted to know if it can be updated to also allow for the block to maintain the location and just align from the original location. This is helpful for aligning survey block to the orientation of the road line object. The code is attached to this post. LM_BlockAlign.lsp
-
Hi i want to develop commercial dynamic blocks, is there a way to protect them against piracy? Thanks S
-
When I use the interactive pan I sometimes get stuck in that mode and have to hit the ALT button to get my cursor to change back from a hand to a box. Does anyone else experience this? Is there a fix? Thanks
-
Block showing distance with arrow pointing in correct direction?
Akeane posted a topic in AutoLISP, Visual LISP & DCL
So the problem im having is i have code that runs to show the offset of measured points to design points, unfortunately the code works by inserting one of 4 predefined blocks for NSEW, or one of 4 when in 2 directions; only showing orthogonal distances. These work by passing through the distance to the block tag, and then comparing the EW, and/or NS values to determine the correct arrow direction to insert the correct block. What i want is instead of using orthogonal distances, is to have an arrow block within these blocks, that changes the direction of the arrow, based on a bearing that you pass through. eg if the horizontal distance between 2 points is 25mm at a bearing of 45 degrees, then a tag is created as per normal with 25 and an arrow point 45 degrees. Any good ideas? I've looked in the forums and couldn't find anything to solve this. Attached is an image of what i have currently made, note the aligned one showing 130mm is kinda what i want, but that arrow is not dynamic, it just goes left or right and the whole block is just rotated to show the bearing. It makes for a messy plan and a lot of neck craning to present to a client -
Adding Dynamic updating to text change LISP? Thanks
tmelancon posted a topic in AutoLISP, Visual LISP & DCL
Hey guys I found this LISP routine that allows me to change text in a drawing to anything I specify. Works great, however. My question is how do I code in here so the text updates dynamically as I click on them, instead of dashing them and waiting for user to hit enter for the changes to appear. (defun c:req ( / v1 v2 v3 newtx nme oldtx) (setvar "cmdecho" 0) (prompt "\nPick text to be changed.") (setq v1 (ssget '((0 . "TEXT")) )) (setq newtx "REQUIRED") (setq newtx (cons 1 newtx)) (setq v2 0) (if (and v1 newtx) (while (< v2 (sslength v1)) (setq nme (ssname v1 v2)) (setq oldtx (assoc 1 (entget nme))) (setq v3 (entget nme)) (entmod (subst newtx oldtx v3)) (entupd nme) (setq v2 (+ v2 1)) ) ) ) -
I want to change the text "A" in my dynamic block to "B,C,D,E,..." When i click on a blue arrow. and the text "16 A" to "20 A , 25 A, ..." When i click on another blue arrow. what is the best way to do this ?
-
Apologies if this is asked and answered. I can't find it. I have a dynamic block that is fairly complex. I select it to highlight the grips, I pull a stretch grip up. The block looks horrible, things that are supposed to stretch don't. Or what's almost worse is 1/2 of a line will stretch. I then leave the block highlighted and type "bedit" and the command line. When the editor selector opens, the block is already highlighted because I left it highlighted. I enter the editor. Here's the weird/magic part. I need to change something. Anything, no matter how small. I've learned that all I have to do is change the zoom - so I give my scroll wheel a little 'flick'. Then I close the editor with changes saved. When the block in the drawing reappears, it's perfect. Not ugly any more, all the issues have corrected themselves. I believe several of my more complex dynamic blocks all do this. Attached is a gif with a visual of the above description. I've also attached the block itself. This has been going on for years, I upgrade each year with the hopes it is resolved. Right now I'm on 2018. I believe I tried 2019 last spring, but now I'm not sure I remember that properly. It happens on my computer, as well as at least 4 other computers attempted by co-workers. And it doesn't happen every time, it's almost like a setting in the drawing it's inserted into. However, every one of our drawings starts from the same template file. Any help or insight is appreciated. Thanks in advance. 1-Line Inverter Hor w AIC.dwg
-
Hi. Maybe someone here in this forum can help me. I'm trying to set the distance for a dynamic block of a single parameter; which is linear and is called Distance1. I do not know what I'm doing wrong, but I can not do it and change the desired distance. He helped me with the functions of Lee Mac, but something is wrong. Any help very similar, I will be completely grateful. (defun c: ddd (/ obj dd) (if (y (setq obj (car (entsel "\ ndynamic block:") (setq dd (getdist "\ Length:")))) (= "AcDbBlockReference" (vla- get-objectname (setq obj (vlax-esame-> vla-object obj)))) (=: vlax-true (vla-get-isdynamicblock obj)) ) (LM: setdynpropvalue obj "Distance1" dd) ) (princ) ) (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)
-
diesel expression for dynamic level block
lstampfer posted a topic in AutoCAD Drawing Management & Output
Good morning everyone, I am currently working on a dynamic block to show the level of a point in a sectional drawing. As you see on the picture, the base of the block is placed on the zero level and the triangle with the value can be moved to any point of the drawing and retrieves the Y-Value of this little yellow circle object representing the level of this point. What I am trying to do now, is to use a diesel expression to add a "+" for a positive value and a "%%P" for a value of zero. What I have now appears to be working, but does not update dynamically when I move the level-mark. Any ideas on what I have to change or if this is possible at all? Any help appreciated. Here is the expression I am using now: $(if,$(EQ,$(=,%%).Center \f "%lu2%pt2%pr2">%,0),1),"%%p",$(if,$(EQ,$(>,%%).Center \f "%lu2%pt2%pr2">%,0),1),"+"," "))%%).Center \f "%lu2%pt2%pr2">% -
Good Afternoon, I am working on an issue at my company and I hope I can get some help. I work at a metal panel company and I was hoping that I could insert a table that will update due to panel dimensions. What I would really like to see is a table that can give me Length and Width as well as the bends associated with the panel for fastening. What would be amazing is if I could get that table to give me the aforementioned information as well as being able to account for "corner panels", etc. since that is counted as one panel in this instance. Can this all be connected to a panel number? Please let me know if this is unclear. Thank you so much!
-
Flipping Hatch Gradients when using the Flip function of a Dynamic Block.
Scottie Fox posted a topic in AutoCAD Drawing Management & Output
Greetings all, I've just joined the CADTutor site as I'm getting back into AutoCAD (using the 2018 version) and have very little prior experience (previously used AutoCAD 2008 / 2009 for basic balustrade drawings many years ago). I'm trying to become a freelance draftsperson in the Aluminium window and door industry and am currently working on Dynamic blocks. I'm using a hatch pattern on the glass with a gradient of 180 (so it appears lighter in the pocket) and have added several functions including a flip function into the block. Unfortunately when using the flip function the gradient remains unchanged (doesn't flip with the hatch or change the angle to 0) and I can't figure out what I'm doing wrong. I'm using attributes for the extrusion codes / notes so I can mirror the block without any problems but it would just be so much quicker and easier to use the flip function. If anyone can provide some insight it would be much appreciated. Regardos, Scottie. -
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?
-
- dynamic blocks
- dynamic block
-
(and 3 more)
Tagged with:
-
How To Update Dimensions To Block Parameters
Walker140 posted a topic in AutoCAD 2D Drafting, Object Properties & Interface
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,-
- dynamic
- dimensions
-
(and 3 more)
Tagged with:
-
Assign Integer/Double value to Dynamic Block Custom Property
JonHilll posted a topic in AutoLISP, Visual LISP & DCL
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 -
Dynamic block does not work in a new drawing
Faouweb posted a topic in AutoCAD 2D Drafting, Object Properties & Interface
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 -
Hello, I am trying to create a dynamic block that shows a spiral conveyor in several different configurations. I have text that needs to be able to be turned off and on. I had it working until I added a flip function. Now the text won't turn off and you have to select the "Angle" twice to get it to change to the next configuration. I have "LookUps" for the angle and direction, and for the text visibility. I've tried every configuration I can think of. Not sure what I'm doing wrong. Any suggestions? I've included the file. Spiral - 19.5'' BF Ascending.dwg
- 5 replies
-
- flip parameter
- dynamic
-
(and 2 more)
Tagged with:
-
Help...! I am a looking for the dimvar (?) setting which sets my zoom window / zoom previous command to "snap" to the selected area and / or the previous. In my re-install of my AutoCAD LT software I've lost this setting and it does the dynamic zoom, showing the progression zoom on screen. Anybody know how I can fix this? Karl J.
-
Dynamic Array Not Working
jkoll66 posted a topic in AutoCAD 2D Drafting, Object Properties & Interface
I have a simple drawing that I would like to add an array action to. I just can't get it to work. I'm not sure what's going on, but when I grab the grip and move it, the rectangle around the drawing disappears and nothing arrays. I've attached the file. Please help! Thanks. AutoCAD 2016 Flow Rack.dwg -
Dynamic Block with different x,y,z scale?
Jmclachlan posted a topic in AutoCAD 2D Drafting, Object Properties & Interface
As a result of multiple updates of AutoCAD software and addition of 12D software I have lost the ability to block replace a block with different x,y,z scales with a dynamic block and have the dynamic block retain its function. Is there a way for the dynamic block to work with different x,y,z scales?- 3 replies
-
- dynamic block
- dynamic
-
(and 1 more)
Tagged with:
-
Link Dynamic Scalebar to Viewport Upon Insert
bretwieseler posted a topic in AutoCAD 2D Drafting, Object Properties & Interface
Hello, I don't even know where to begin... I'm trying to construct a scale bar that can be linked with a chosen viewport, upon insertion into paperspace. Civil3d 2015 already has several of these "preloaded" in the Layout Element panel, but these scalebars are not "smart", requiring input from the user (I'm trying to create these for newbies in our office). Any thoughts or help is appreciated. -
Dynamic Block Copy/Rotate or Polar Array?
rhgrafix posted a topic in AutoCAD 2D Drafting, Object Properties & Interface
I am trying to make a dynamic block to somewhat mimic the 3D Revolve command, since I can't Sweep or Revolve 3D entities in the dynamic block, I want to fake it by making a revolved curved piece that travels 5° increments of a circle at a time, the dynamic part would be to make it copy itself end to end using the same axis as the part. I tried polar and rotate, they won't copy AND rotate, they always stay in a straight line. Anyone know how to do this? Thanks! R.L. Hamm -
Dynamic Block Editor Label Size
rhgrafix posted a topic in AutoCAD 2D Drafting, Object Properties & Interface
This search has me baffled as to how there seems to be no trace of this question/answer on the whole internet! How can I make the labels (Distance, Lookup etc.) bigger in the dynamic block editor? I can tell they are relative to screen size, I zoom in and they adjust, I just need them a little bigger. Is it a windows setting? I've looked in Options/Display/Fonts and it only controls command line size. Thanks! R.L. Hamm