Display full version of the post: Hide Dimensions of a specific value

BehzadCAD
24.03.2016, 04:37
Hi All,I couldn't find answer to this matter. Please see if you can help.As you can see in the picture, the shape on the right side shows a dimension with a value of zero. This is a dynamic block and you can change the height of first line along with it's dimensions from properties menu.Question:Is there anyway to set the dynamic block so if the value of a dimension is 0 then the whole dimension goes hidden automatically without the need of editing the block?If not all elements of the dimension, can the text goes hidden or replaced by a space character which shows nothing? Tags are not an issue, if we change them to architectural tags you wont see extra line.I appreciate your time and I keep an eye on the board in case I see a question that I can answer if not answered.uploads/342811/20160324_Hide_Dimension.dwgKind regards,Behzad

Vladimir Michl
24.03.2016, 08:14

I doubt this can be done with just the dynblock functionality but you can use the following LISP code to hide "singleton" dimensions automatically: [CODE];hide zero/singleton dimensions - www.cadforum.cz(defun C:HideDIM0 ( / ss ent obj)  (vl-load-com)  (setq ss (ssget "_X" '((0 . "*DIMENSION"))))  (if ss  (while (setq ent (ssname ss 0))   (setq obj (vlax-ename->vla-object ent))   (if (zerop (vla-get-measurement obj))    (vla-put-visible obj :vlax-false)    (vla-put-visible obj :vlax-true)   )   (ssdel ent ss)  )  ) (princ))[/CODE]

BehzadCAD
29.03.2016, 00:25
Thanks Vladimir,I don't know how to use/run Lisps. I will try to learn it then I try your solution.There is a problem tho. Lets say I have made a dynamic block and I share it here. Shall I ask users to run sum LISPs to make the blocks work correctly?Unless, we can attach the LISP within the block! can we do that?If yes, can you do attach your LISP to the block in drawing I uploaded so I can see how it is done?I appreciate it very much. Meanwhile I go google and learn about LISPs Regards,

BehzadCAD
29.03.2016, 04:31
Vladimir,I learnt how to write, save, load and run a Lisp.I opened drawing that I attached, select the block, and set the "Distance1=0" in the properties.Bottom Dimension changes to a zero. Then I try your command, it does not hide the dimension.I draw another dimension, select it, put one grip on another, dimension becomes 0, and then I run your command, it works and dimension disappears. I draw another zero value dimension. make a block out of it. run the command. It doesn't work. I explode the recently made block of the dim and run the command again. It works. Problems,1) The lisp cannot hide zero value dimensions within blocks and you have to explode blocks. 2) The lisp cannot find all zero value dimensions.3) The hidden dimensions exist in the drawing (you can check by select all) but you cannot recover them and make them appear.I am not asking you to go through your lisp and fix the problems i mentioned. I am just letting you know these for your information.I am after a solution so that when you put a grip of a dimension on another grip of the same dim it disappears because the value became zero and/or if you change a dynoblock and some dimensions withing the block change to zero they disappear. If they are withing a block they are easily recoverable by changing them by block grips or in properties menu.If any idea please advise. Thanks. Meanwhile I keep searching.RegardsBehzadCAD2016-03-29 04:31:38