Author Topic: Dimension Style Overrides  (Read 2095 times)

0 Members and 1 Guest are viewing this topic.

MSTG007

  • Gator
  • Posts: 2598
  • I can't remeber what I already asked! I need help!
Dimension Style Overrides
« on: January 02, 2018, 11:35:19 AM »
I am trying to understand (prob a noob thing) how dimension style overrides work.

I have a detail that has its own Style. However, in some drawings I insert the detail and go to explode it to edit it, the test and dim style is no correct. (goes big, etc.)

I have a routine I try to use, but it always shows up in the dimension style manager under the Style Name as <style override>

Code: [Select]
(command "-dimstyle" "Variables" "DETL" "DIMADEC" "4" "DIMASZ" "0.1" "DIMAUNIT" "1" "DIMCEN" "0.00" "DIMCLRT" "256" "DIMDEC" "2" "DIMEXE" "0.09" "DIMGAP" "0.04" "DIMTAD" "1" "DIMTDEC"

"2" "DIMTIH" "OFF" "DIMTOH" "OFF" "DIMTXSTY" "DETL" "DIMTXT" "0.07" "-dimstyle" "apply" "all" "")

However, if I do not use the routine, and manually edit each field in the Dimension Style Manager. then explode the detail, everything adjusts normally.

Long story short. I use the same detail in some drawings, and explode it to edit and everything works as it should. I use the same detail in other drawings and when I explode it to edit, it does not show correctly and I have to edit all the fields.

Any help would be great!
Civil3D 2020

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Dimension Style Overrides
« Reply #1 on: January 04, 2018, 06:04:18 AM »
The issue is probably related to conflicting dimension styles. If you compare the block source drawing with the target drawing that displays the problem, you will find that they have dimension styles with the same name but with different settings. IMO it would be less confusing and more logical if dimensions would automatically be updated upon insertion of a drawing file. But that does not happen. As you have found out exploding the block will trigger an update. So will changing a dimension style setting.
« Last Edit: January 04, 2018, 06:08:48 AM by roy_043 »

MSTG007

  • Gator
  • Posts: 2598
  • I can't remeber what I already asked! I need help!
Re: Dimension Style Overrides
« Reply #2 on: January 04, 2018, 07:17:31 AM »
Gotcha. So in this case, the routine I have would work for this application.

I guess I can ask this, right now I just have the basic routine that converts the everything in the drawing. How hard is it, to make it a selection set? (Where I can window the details I want to apply the updated correct style too)?
Civil3D 2020

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Dimension Style Overrides
« Reply #3 on: January 04, 2018, 06:24:20 PM »
I have a hard time understanding what you are trying to say. Contrary to what you seem to suggest you are not a noob (you have joined this forum in 2004), so please clarify.

In the meantime here is some code that will trigger an update of those nested dimensions. Both functions (UpdateDimBlks and UpdateDimBlksAlt) should have the same effect.

Code - Auto/Visual Lisp: [Select]
  1. (defun c:UpdateDimBlks ( / doc elst old)
  2.     (setq elst (entget (vlax-vla-object->ename dim)))
  3.     (setq old (assoc 40 elst))
  4.     (entmod (subst (cons 40 (* 1.0001 (cdr old))) old elst)) ; Temporarily change the DIMSCALE.
  5.     (entmod (subst old (cons 40 (* 1.0001 (cdr old))) elst))
  6.   )
  7.   (vla-regen doc acallviewports)
  8.   (princ)
  9. )
  10.  
  11. (defun c:UpdateDimBlksAlt ( / doc)
  12.   (vlax-for blk (vla-get-blocks doc)
  13.     (if
  14.       (and
  15.         (= :vlax-false (vla-get-isxref blk))                     ; Skip xrefs.
  16.         (not (wcmatch (strcase (vla-get-name blk)) "`*D*,`*T*")) ; Skip anonymous dimension and table blocks.
  17.       )
  18.       (vlax-for obj blk
  19.         (if (vlax-property-available-p obj 'textstyle)   ; AcDbDim* and AcDbFcf (Tolerance).
  20.           (entmod (entget (vlax-vla-object->ename obj))) ; Vla-update has no effect.
  21.         )
  22.       )
  23.     )
  24.   )
  25.   (vla-regen doc acallviewports)
  26.   (princ)
  27. )

MSTG007

  • Gator
  • Posts: 2598
  • I can't remeber what I already asked! I need help!
Re: Dimension Style Overrides
« Reply #4 on: January 08, 2018, 07:41:32 AM »
hey thank you for the info. Apparently, I just had re-read what I was asking. don't know why I was asking that... lol.
Civil3D 2020