Jim Clayton Posted November 14, 2019 Posted November 14, 2019 This is going to be really confusing until you look at the attachment. I'm trying to make a Dynamic Block of sorts for what is essentially a ruler/scale/indicator that gets mounted to a liquid level chamber. It has mounting hardware on the top and bottom and a logo at the top. The shorter/longer it is will be the deciding factor in how many numbers are visible on the indicator. My goal is to make it so that as the Logo moves up or down, the numbers either become visible or covered up. I'm trying to figure out if this is possible and if so, how? I realize none of this makes any sense. Please look at the attachment for clarification. INDICATOR.dwg Quote
BIGAL Posted November 15, 2019 Posted November 15, 2019 There are sample "Scale" dynamic blocks its in the Ribbon, may be usefull start, you can definitely change visibility states in a dynamic block. Is it easier to do a block with multiple attributes and just reset attributes to " " so not visible maybe 20 attributes. Pretty easy to do a repeat of num atts with increment using lisp. Quote
Jim Clayton Posted November 15, 2019 Author Posted November 15, 2019 Thanks Al. I appreciate the help, however I'm not sure this is quite what i'm after. It's hard for me to give a proper explanation because I don't recall coming across something like this before. The only thing I can relate it to is a Dynamic Block, which seems simple enough to do with the repeating tick marks of the ruler. The area where I run into a mental roadblock on it is the numbers. Some of them are repeating but only until they get to the next number on the scale, then it's a new number. I can't figure out how to get around that. I welcome suggestions though. Also I'm running ACAD2014...I'm not sure I have the above feature. Tks. Quote
Jim Clayton Posted November 15, 2019 Author Posted November 15, 2019 Maybe if I make the top portion a block and somehow incorporate something similar to the Wipeout command so that as the block moves over it, it becomes hidden? idk Quote
ronjonp Posted November 15, 2019 Posted November 15, 2019 I'd make a block of a section and assign the text an attribute. Then they could easily be stacked and code could fill in the numbers. Why do you show so much detail? Quote
Jonathan Handojo Posted November 15, 2019 Posted November 15, 2019 (edited) Just an idea in top of my head, this could be done by using grread. First, specify a base point... which is the bottom of your scale. Second, select the block to move. Third, as you move your mouse up and down, the drawing will replenish showing the new scales. by: (vla-put-InsertionPoint block new_point_with_y_value_of_mouse_pointer) I can use AutoLISP, but not to that extent. Maybe someone has a better idea than me. Thanks Jonathan Handojo Edited November 15, 2019 by Jonathan Handojo Quote
Jim Clayton Posted November 15, 2019 Author Posted November 15, 2019 That's not a bad idea actually...I may try to run with that. Thanks. And to your question, these go on the outside of Liquid Level Chambers for process applications. They have to be visible and precise so that operators can keep track of Levels (as I understand it...I'm just a cad monkey). But I'm working on overhauling the entire process for drawing these because it currently sucks and the blocks are a nightmare and unnecessarily time consuming. Quote
Jim Clayton Posted November 15, 2019 Author Posted November 15, 2019 I'm not familiar with grread….looking for examples online now. Tks. Quote
Jonathan Handojo Posted November 15, 2019 Posted November 15, 2019 22 minutes ago, Jim Clayton said: I'm not familiar with grread….looking for examples online now. Tks. Here's a small example I made with dimensions. Use this lisp code with the command dim_y_example and select the four dimensions. Then, as you move your mouse, their text position changes based on the y-value of the mouse pointer. (defun c:dim_y_example ( / *error* in_list iter) (defun *error* (msg) (vla-EndUndoMark adoc) (if (not (wcmatch (strcat msg T) "*break*,*exit*,*cancel*")) (princ (strcat "\nError: " msg)) ) ) (setq acadobj (vlax-get-acad-object) adoc (vla-get-ActiveDocument acadobj) msp (vla-get-ModelSpace adoc)) (vla-StartUndoMark adoc) (setq test_dim (ssget '((0 . "DIMENSION")))) (if test_dim (progn (setq iter 0) (repeat (sslength test_dim) (setq in_list (cons (ssname test_dim iter) in_list) iter (1+ iter)) ) (setq points (mapcar '(lambda (x) (safearray-value (variant-value (vla-get-TextPosition (vlax-ename->vla-object x))))) in_list)) (princ "\nSpecify y-point for dimension") (while (eq (car (setq grvalue (grread T 15))) ; Returns the grread value. car grread indicates the type returned, cdr grread indicates the value of that grread. 5) ; A value of 5 indicates mouse movement. cdr grread would return the current coordinate of the mouse pointer, if T is supplied. (mapcar '(lambda (x y) (vla-put-TextPosition (vlax-ename->vla-object x) (apply 'vlax-3D-Point (list (car y) (cadadr grvalue) (caddr y))))) in_list points) ) ) ) (vla-EndUndoMark adoc) (princ) ) However, this is very basic. To produce your drawing and optimise grread to a certain extent is beyond my reach. Thanks, Jonathan Handojo Dimension_example.dwg Quote
Jim Clayton Posted November 15, 2019 Author Posted November 15, 2019 Dammit...unable to open it because I'm running Autocad 2014...trying to find a way to convert it now. I appreciate the help. Tks. Quote
Jonathan Handojo Posted November 15, 2019 Posted November 15, 2019 3 minutes ago, Jim Clayton said: Dammit...unable to open it because I'm running Autocad 2014...trying to find a way to convert it now. I appreciate the help. Tks. Hopefully this time. Dimension_example.dwg Quote
Jim Clayton Posted November 15, 2019 Author Posted November 15, 2019 Thanks...was able to download. Trying to break it now. I appreciate all the help. Quote
BIGAL Posted November 16, 2019 Posted November 16, 2019 Can you post an image/dwg of what you want ? The progress bar comes to mind. Quote
Jonathan Handojo Posted November 16, 2019 Posted November 16, 2019 (edited) 3 hours ago, BIGAL said: Can you post an image/dwg of what you want ? The progress bar comes to mind. I believe he did on his very first post... With a detailed text of what he want to achieve as well, where the scale can extend and show results. I'm just not sure if it's to be infinitely extended. Edited November 16, 2019 by Jonathan Handojo Quote
BIGAL Posted November 16, 2019 Posted November 16, 2019 It could be done via a vertical array of blocks and numbers added but it would not be dynamic other than the array. A dynamic number block and rest is probably easy. Quote
Jim Clayton Posted November 18, 2019 Author Posted November 18, 2019 See I was initially thinking along the same lines with vertical array. I made a similar block for horizontal flex armor a while back and thought it could be the same principle but in the opposite direction. I can manage the repetition of shapes fine, but the area where I keep hitting a mental roadblock is the Numbers. I'm not sure how to get the two to tie in together aside from leaving blank spaces to fill in, but that seems like it's almost just as time consuming. Certainly the collective genius of the CadTutor forum can figure out a way around this. Quote
BIGAL Posted November 19, 2019 Posted November 19, 2019 (edited) The horizontal lines would have the "Ft" "in" 3 6 & 9 as part of a block the Actaul Feet text easiest done as attribute and update in order as the array will create in an order but would have to explode probably the array. You could insert as a block add 0 1 2 etc then group them so if erase or move all go. array block1 given distance = howmany array block2 given distance = howmnay x=-1 repeat how many = distance x=x+1 insert block att1 =0 next 1 2 3 add to Y vertical spacing end repeat all done Edited November 19, 2019 by BIGAL Quote
Jim Clayton Posted November 21, 2019 Author Posted November 21, 2019 My apologies Al, and everyone else for that matter. Your efforts haven’t gone unnoticed. I had free time when I originally asked the question, but then immediately became bogged down with work. I’ll circle back around to this in the near future. I appreciate the help. 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.