muzicman82 Posted June 4, 2020 Posted June 4, 2020 Hi all, I'm not new to AutoCAD but I've honestly never created a dynamic block and don't know what I need to do. I've watched a few tutorials on dynamic blocks but what I am trying to do seems a little different than the typical use-case. I do a lot of audio-visual one-line drawings in AutoCAD. I have device equipment blocks showing all input and output connectors. I manually make them for every device but am looking to have a go-to generic dynamic block for one-off simple devices. Here are examples of finished manually created blocks: However, what I am looking for is a block that dynamically transform from this: To this: Ideally, block parameters would define how many "lines" of connections there is. Or, I am guessing there is a way for the block to be stretched such that the lines of connections become visible, but I do not want free stretch. The bottom edge of the rectangle should be a specific spacing from the middle of the last line of text. I'm sure the text could be shown or hidden with visibility, but then I don't understand how I'd resize the rectangle as required. Attributes can allow text for NAME and CONN for each IN/OUT. The manufacturer, model, and DEV_ID are all attributes. If for example there are a different number of inputs/outputs, I imagine just leaving the text attributes blank is enough to effectively hide them. If there's videos on doing this sort of dynamic block, links are appreciated. Most of the videos I've found are discussing layout/graphic objects. Thanks! Quote
CyberAngel Posted June 4, 2020 Posted June 4, 2020 To me that looks like a table. Have you looked into modifying a table style? Have you done any programming? Do you ever make these blocks smaller instead of larger? Is there an upper limit on the number of rows? Are there different colors for wires that have different functions? Quote
muzicman82 Posted June 4, 2020 Author Posted June 4, 2020 Just now, CyberAngel said: To me that looks like a table. Have you looked into modifying a table style? Have you done any programming? Do you ever make these blocks smaller instead of larger? Is there an upper limit on the number of rows? Are there different colors for wires that have different functions? They look like a table, but they are never drawn like tables. The wires are drawn in separate from the blocks. The blocks are often as small as 1x in and 1x out, or something there's just 1x input or 1x output. I've done programming but not AutoLISP... I don't have an upper limit but I think larger blocks would still get drawn manually, just because they often have more complex layouts. My thinking for the dynamic block is that I could always start it with it, and hopefully explode it with values and then modify as necessary. Here's a more complicated example: Quote
steven-g Posted June 4, 2020 Posted June 4, 2020 Dynamic blocks are intended to be used with geometry (lines, arcs, etc.) Although you might possibly be able to array text items you certainly cannot array attributes (at least not in any usable form). If you are using full Autocad it might be worth seeing what the users in the Lisp section might be able to see as options but as far as dynamic blocks go I would forget the idea, unless you have a defined set of devices with numbers of inputs/outputs that could be constructed individually and placed in a block with visibility states. Other than that you are just asking for a headache and I would save my efforts for better use. Don't get me wrong the idea looks great but in my humble opinion completely unworkable for a dynamic block (other than visibility states) Quote
BIGAL Posted June 4, 2020 Posted June 4, 2020 Like others "insertrows" in a table is the simple way to go, just keep adding rows and populating cells the Aux with lines not sure may be able to cheat a little with | and _. I did like 1000 rows in one project I had a go at so its possible. Happy to provide example code. Quote
SLW210 Posted June 5, 2020 Posted June 5, 2020 I have moved your thread to the AutoCAD Drawing Management & Output Forum. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.