I just answered the wrong message, it was supposed to be for ambrosl
defun c:ChangeDimStyle ( / sel cnt ent ed)
(if (setq sel (ssget '((0 . "dimension") (3 . "Standard"))))
(progn
(setq cnt 0)
(while (< cnt (sslength sel))
(setq ent (ssname sel cnt)
ed (entget ent)
ed (subst '(3 . "MyStandards") (assoc 3 ed) ed)
cnt (1+ cnt))
(entmod ed)
(entupd ent)
)
)
)
(princ)
)
I did the test did not work, maybe because I did not talk about the annotative.
The dim style "UM_50.000000" is not annotative.
The dim style "Unidade cm" is annotative
The Image 01 is the default when the block is imported. (Dim Style UM_50.000000 / No Annotative)
In Image 02 the ChangeDimStyle command was used, the Dim Style changed to "Unidade cm", but the Annotative option was not changed to yes. (When I manually change the dim style from "UM_50.000000" to "Unidade cm", the Annotative option automatically switches to YES
Image 03, is how the properties of dimensions must be.
Dim Style "Unidade cm"
Annotative: Yes
Annotative Scale: 1:50cm
"You mention scale factor, are you referring to the Dimension Scale of the dimension?"
Yes, I referred to the "Dim Scale Linear"
For you to understand, I will explain what I have to always do manually.
1 - Insert a block.
2 - Change the scale to 50.
3 - Explode.
For this I already create:
(defun c:scviga()
(command "ddinsert" "s" "50" pause)
(setq vge (entlast))
(command "explode" vge)
4 - Select all dimensions with dim style "UM_50.000000" and change to "Unidade cm"
5 - Select all dimensions with dim style "UM_25.000000" and change to "Unidade cm", and also change the Dim Scale Linear to "0.5"
6 - Select all dimensions and apply ai_dim_texthome
This is the first routine I'm trying to create.