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
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