Author Topic: Update an existing DIM style ...  (Read 1786 times)

0 Members and 1 Guest are viewing this topic.

Hangman

  • Swamp Rat
  • Posts: 566
Update an existing DIM style ...
« on: May 03, 2011, 12:10:52 PM »
Morning everyone, glad to see you all here for this uh, ...  bored meet'n.    :lmao:

sorry

So, I have several drawings I need to fix and they have dimensions that take forever to manually edit.  I want to update the dimension style by a lisp routine so I can get these done reletively quickly.
I ran a search for "change dim style" and found this post http://www.theswamp.org/index.php?topic=8235.0 by CAB which has a wealth of information in it.  I am assuming to update a dimension style I would follow roughly the same format, but I have a bunch of existing dimensions so I can't just change the style itself.

So, here's what I need/want to do.  The following variables are the ones I need to change:
DIMATFIT  (arrow & text fit)
DIMLWD  (Line & leader lineweight)
DIMLWE  (Line lineweight)
DIMTAD  (Text above Dimension line)
DIMTIH  (Text inside extensions)
DIMTMOVE  (Text movement)

So, I can grab all dimensions
Code: [Select]
< ... >
  (setq i -1
        objDimensions (ssget "_X" '((0 . "DIMENSION"))))
  (while (setq objDim (ssname objDimensions (setq i (1+ i))))
    (setq objInfo (entget objDim))
But how do I get the variables listed above for each dimension and apply the changes to each existing dimension?

Then when that is done, how can I change the dim style so any new dimensions created will have the new variable settings?  Would I (for example) create a temporary dim style and with each dimension I grab, put on the new dim style, then when all the dimensions have been moved over, change the original dim style - using CAB's example link posted above - and then move all the dimensions back to the original style?

What are your thoughts and suggestions on this idea?

Thank you all for your expertise, that's why I called you all to this uh, ... bored meet'n.    ;-)
Hangman  8)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Drafting Board, Mechanical Arm, KOH-I-NOOR 0.7mm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Crank

  • Water Moccasin
  • Posts: 1503
Re: Update an existing DIM style ...
« Reply #1 on: May 03, 2011, 01:14:08 PM »
You don't have to change the dimensions, just the dimstyles:

Pseudo-code:
Code: [Select]
-store name of current dimstyle

- For every dimstyle:
  - Restore dimstyle
  - Change your dimvariables
  - Save the dimstyle under it's own name

- Restore the active dimstyle

The result of this is that if there are overrides, they overrides won't change. If  the value of overrides are the same as in the new dimstyle, the overrides will be removed.
Vault Professional 2023     +     AEC Collection