CAD Forum - Database of tips, tricks and utilities for AutoCAD, Inventor and other Autodesk products [www.cadforum.cz]
CZ | EN | DE
Login or
registration
  Visitors: 9736
RSS channel - CAD tips RSS tips
RSS discussions

Discussion Discussion forum

 

HelpCAD discussion

 
CAD Forum - Homepage CAD discussion forum - ask any CAD-related questions here, share your CAD knowledge on AutoCAD, Inventor, Revit and other Autodesk software with your peers from all over the world. To start a new topic, choose an appropriate forum.

Please abide by the rules of this forum.

How to post questions: register or login, go to the specific forum and click the NEW TOPIC button.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Topic ClosedHide Dimensions of a specific value

 Post Reply Post Reply
Author
BehzadCAD View Drop Down
Groupie
Groupie


Joined: 04.Feb.2013
Location: Australia
Using: AutoCAD2013
Status: Offline
Points: 20
Direct Link To This Post Topic: Hide Dimensions of a specific value
    Posted: 24.Mar.2016 at 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.


Kind regards,
Behzad
Back to Top
Vladimir Michl View Drop Down
Moderator Group
Moderator Group

Arkance Systems CZ

Joined: 26.Jul.2007
Location: Czech Republic
Using: Autodesk software
Status: Offline
Points: 2018
Direct Link To This Post Posted: 24.Mar.2016 at 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:
 
;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)
)
Vladimir Michl (moderator)
Arkance Systems - arkance-systems.cz - Autodesk reseller
Back to Top
BehzadCAD View Drop Down
Groupie
Groupie


Joined: 04.Feb.2013
Location: Australia
Using: AutoCAD2013
Status: Offline
Points: 20
Direct Link To This Post Posted: 29.Mar.2016 at 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 Smile

Regards,

Back to Top
BehzadCAD View Drop Down
Groupie
Groupie


Joined: 04.Feb.2013
Location: Australia
Using: AutoCAD2013
Status: Offline
Points: 20
Direct Link To This Post Posted: 29.Mar.2016 at 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.

Regards


Edited by BehzadCAD - 29.Mar.2016 at 04:31
Back to Top

Related CAD tips:


 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0,494 seconds.