PDA

View Full Version : Edit Multiple Dimensions Automatically



CADdancer
2005-04-08, 06:59 PM
Hello to All AUGI Members:

I am trying to develop a lisp routine that will enable me to select a group of dimensions and perform a text edit on these dimensions. In some cases I would want to capture the automatic dimension value and then replace it with a text modifier equal to the original dimension value.

The code below does not work properly maybe someone can point out what I am doing incorrectly.

####################### CODE START
(DEFUN C:dimch ()
(prompt "\n...")
(prompt "\n...Select Dimensions to Overide...: ")

(setq ent_list (ssget (list (cons 0 "DIMENSION"))))
(if (/= ent_list " ")
(progn
(command "undo" "mark")
(setq ent_list_length (sslength ent_list))
(setq index 0)
(while (< index ent_list_length)
(setq ent_data (entget (ssname ent_list index)))
(setq DV (cdr (assoc 42 ent_data)))

(setq Dval (Rtos DV 4 3))
(princ Dval)
(command "._DimEdit" "_N" Dval ent_data "")

(entmod ent_data)
(setq index (1+ index))
)

)
(prompt "...No Dimensions Selected...")

)
)
####################### CODE END

Any assistance with this would be appreciated.

Regards,
Vince

Opie
2005-04-08, 07:19 PM
You could try replacing the following line

(command "._DimEdit" "_N" Dval ent_data "")
with this one

(setq ent_data (subst (cons 1 Dval)(assoc 1 ent_data)ent_data))

CADdancer
2005-04-08, 07:25 PM
Rich:

Thank you for your quick response.........The input you gave me worked great......!!!!

Regards,
Vince

Opie
2005-04-08, 07:41 PM
Rich:

Thank you for your quick response.........The input you gave me worked great......!!!!

Regards,
Vince
Your welcome.

Are you just trying to modify the format of the dimension?

CADdancer
2005-04-11, 08:44 PM
Rick:

We work with various consultants that send us elevation drawings of the structure. These elevations have a string of dimensions for all of the floor to floor height distances that are in the current drawing scale. As a structural engineer we develop a drawing called a column schedule that is a non-dimensional (1:1 scale) elevation schematic representation of all of the columns in the structure. I wanted to use the dimension string from the consultants drawing so I would not be required to re-enter all of the dimension text on the column schedule however when we copied the dimensions to the column schedule and resized the dimensions to conform with the 1:1 schedule drawing the dimension text strings would changes to reflect the smaller distances. By converting the real dimension to a typed text string, when the distance of the dimension lines changed the text string would not change and therefore I did not need to re-enter all of the dimension strings.

Once again, thank you for your help.....!

Regards,
Vince

kennet.sjoberg
2005-04-11, 10:39 PM
Something like this ? ( one in a time )


(defun c:LockDim (/ Ent EntDxf )
(if (setq Ent (entsel "Select one dimension : " ) )
(progn
(if (= (cdr(assoc 0 (entget (car Ent )))) "DIMENSION" )
(progn
(setq EntDxf (entget (car Ent )) )
(setq EntDxf (subst (cons 1 (rtos (cdr (assoc 42 Entdxf ) ) 2 0 )) (assoc 1 Entdxf ) EntDxf ) )
(entmod EntDxf )
(princ " Dimension locked !" )
)
(princ " No dimension selected" )
)
)
(princ " No object selected. " )
)
(princ)
)

: ) Happy Computing !

kennet